mirror of
https://github.com/ShaYmez/xlxd.git
synced 2024-11-15 20:51:51 -05:00
fa7b3e8098
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.
15 lines
241 B
Bash
15 lines
241 B
Bash
#!/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
|