From fa7b3e80981fb72f1b21b0bffe8fd331299183f4 Mon Sep 17 00:00:00 2001 From: LX1IQ Date: Sun, 2 Aug 2020 09:56:16 +0200 Subject: [PATCH] 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. --- scripts/watchdog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 scripts/watchdog diff --git a/scripts/watchdog b/scripts/watchdog new file mode 100644 index 0000000..4582bf0 --- /dev/null +++ b/scripts/watchdog @@ -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