buttons: make all button handler scripts return 0
[openwrt/staging/chunkeey.git] / package / base-files / files / etc / rc.button / reset
1 #!/bin/sh
2
3 [ "${ACTION}" = "released" ] || exit 0
4
5 . /lib/functions.sh
6
7 logger "$BUTTON pressed for $SEEN seconds"
8
9 if [ "$SEEN" -lt 1 ]
10 then
11 echo "REBOOT" > /dev/console
12 sync
13 reboot
14 elif [ "$SEEN" -gt 5 ]
15 then
16 echo "FACTORY RESET" > /dev/console
17 jffs2reset -y && reboot &
18 fi
19
20 return 0