2cc6ae4a9d
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
20 lines
285 B
Bash
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
|