tried wordpress, removed

This commit is contained in:
bogale 2026-09-25 23:40:19 +09:00
commit 1031ad5571
8 changed files with 31 additions and 25 deletions

View file

@ -31,9 +31,13 @@
serviceConfig.Type = "oneshot";
script = ''
. /secrets/tgbot.env
${pkgs.curl}/bin/curl "https://api.telegram.org/$BOT/sendMessage" \
-X POST -d "chat_id=$CHAT_ID" -d "text=$TEXT" 2> /dev/null | \
${pkgs.jq}/bin/jq '.result.date |= strftime("%Y-%m-%d %H:%M:%S")'
for msg in "''${MESSAGES[@]}"; do
TEXT="''${msg#*:}"
CHAT_ID="''${msg%%:*}"
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/$BOT/sendMessage" \
-d "chat_id=$CHAT_ID" -d "text=$TEXT" 2> /dev/null | ${pkgs.jq}/bin/jq
sleep 1
done
'';
};
network-watchdog = {
@ -43,12 +47,10 @@
};
script = ''
if [ ! -e /run/network.failures ] || \
${pkgs.iputils}/bin/ping -c 1 -W 3 1.1.1.1 &> /dev/null; then
${pkgs.iputils}/bin/ping -c 1 -W 3 1.1.1.1; then
failures=0
else
failures=$((1+$(cat /run/network.failures)))
fi
if [ $failures -gt 0 ]; then
echo "<5>failures = $failures"
fi
if [ $failures -ge 3 ]; then