DoorPi/root_overlay/bin/healthcheck.sh

14 lines
497 B
Bash
Raw Permalink Normal View History

2022-09-10 17:17:49 +00:00
#!/bin/sh
# This script acts as a dead-man-switch for the door pi.
# It sends a ping to healthchecks.io in regular intervals.
# When a ping is missed (e.g. because the pi crashes) healtchecks
# is configured to send a notification that the pi is down.
LOGFILE=/var/log/healthcheck.log
URL=http://hc-ping.com/7cfd6716-ac74-420a-b322-ef8d5746e0fe
while true; do
echo -n "`date +"[%Y-%m-%d %H:%M:%S]"` " >> $LOGFILE
wget -q -O - $URL >> $LOGFILE
echo "" >> $LOGFILE
sleep 15m
done