Create watchdog

Small watchdog script to check the connectivity to the ambed hardware.
If the usb port gets unresponsive and you get persistent timeouts. The script restarts the ambed service.
You can run the script every "x" via a cronjob.
This commit is contained in:
LX1IQ 2020-08-02 09:56:16 +02:00 committed by GitHub
parent 7fab6c2e66
commit fa7b3e8098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

14
scripts/watchdog Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
sleep 5
PATTERN=timed
FILE=/var/log/syslog
if grep -q $PATTERN $FILE;
then
echo "ambed timeout error"
> /var/log/syslog
service ambed restart
else
echo "all ok"
echo "Exiting..."
exit 0
fi