Skip to content

Instantly share code, notes, and snippets.

@itskenny0
Last active July 24, 2021 16:53
Show Gist options
  • Save itskenny0/7d8bd57d65fa2ea68e18ad2efc9226ea to your computer and use it in GitHub Desktop.
Save itskenny0/7d8bd57d65fa2ea68e18ad2efc9226ea to your computer and use it in GitHub Desktop.
feeding the watchdog on a Raspberry Pi Zero
#!/bin/bash
exec 5>/dev/watchdog # opens file descriptor
upSeconds="$(cat /proc/uptime | grep -o '^[0-9]\+')"
while [ $(cat /proc/uptime | grep -o '^[0-9]\+') -lt 432000 ] ; do
echo "Feeding dog ..."
echo >&5
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment