netFluxNChill
Topic Author
Posts: 2
Joined: 05 Nov 2019, 19:49

Watchdog bash script missing

05 Nov 2019, 20:02

Hello,

I have a RevPi Connect+ V1.0, and I am trying to take advantage of the watchdog feature. The tutorial shows the following:
You can find the file “watchdog.sh” in the directory “/etc/rc.local”.
As well as:
You can execute the script by typing the following command in the command line:
/home/pi/connect/revpi-connect-watchdog.sh/>dev/null_&
Quick note: I think this needs to be ">/dev/null"

However, I have neither the /connect directory nor the /rc.local directory. I am using the image that came with the RevPi Connect+ on startup (I have not flashed a new image), and I can successfully use piTest to access these bits, though I would prefer to use a .sh script for use in a cron job or similar, so I would like to see the example.

I have also tried to find the .sh scripts in the github repositories for the project, but they do not seem to be there. I managed to write a script in C to do what I need, though, again, I would much rather use a bash script.

If that script could be made available, I would appreciate it. Thanks.
 
User avatar
dirk
KUNBUS
Posts: 577
Joined: 15 Dec 2016, 13:19
Location: Ostfildern
Contact:

Re: Watchdog bash script missing

08 Nov 2019, 15:07

Dear netFluxNChill, here the script:
pi@RevPi14607:~ $ cat connect/revpi-connect-watchdog.sh
#!/bin/sh

while : ; do
    # let watchdog trigger on loss of internet connectivity
    if ! /bin/ping -c1 -n 8.8.8.8 > /dev/null 2>&1 ; then
        exit
    fi

    # feed watchdog
    value=$(piTest -q -1 -r RevPiLED)
    value=$(( ($value + 128) % 256))
    piTest -w RevPiLED,"$value"
    sleep 10
done

Who is online

Users browsing this forum: No registered users and 0 guests