pmaports/main/watchdog-kick/watchdog-kick
Filip Matijević 2cc6ae4a9d Add basic support for Nokia N9 (#1101)
Also added the watchdog-kick package:
Some devices (namely Nokia N9/950) use more than one watchdog, and
watchdog-kick package kicks all of /dev/watchdogs? every 10 seconds so
they don't reset the device
2018-01-09 16:42:55 +00:00

20 lines
285 B
Bash

#!/bin/sh
watchdog_kick() {
while true; do
for wd in /dev/watchdog*; do
[ -c $wd ] && echo X > $wd
done
[ -z "$1" ] && sleep 10s || exit
done
}
if [ -z "$1" ]; then
watchdog_kick
else
if [ "$1" != "-1" ]; then
echo "Invalid argument"
exit 1
fi
watchdog_kick $1
fi