diff options
Diffstat (limited to 'package/base-files/files/etc/rc.button/reset')
-rwxr-xr-x | package/base-files/files/etc/rc.button/reset | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset new file mode 100755 index 0000000000..763994d075 --- /dev/null +++ b/package/base-files/files/etc/rc.button/reset @@ -0,0 +1,18 @@ +#!/bin/sh + +[ "${ACTION}" = "released" ] || exit 0 + +. /lib/functions.sh + +logger "$BUTTON pressed for $SEEN seconds" + +if [ "$SEEN" -lt 1 ] +then + echo "REBOOT" > /dev/console + sync + reboot +elif [ "$SEEN" -gt 5 ] +then + echo "FACTORY RESET" > /dev/console + firstboot && reboot & +fi |