21 lines
300 B
Bash

#!/bin/sh
[ "${ACTION}" = "pressed" ] && exit 10
. /lib/functions.sh
logger "$BUTTON pressed for $SEEN seconds"
if [ "$SEEN" -lt 10 ]
then
echo "REBOOT" > /dev/console
sync
reboot
elif [ "$ACTION" = "timeout" ]
then
echo "FACTORY RESET" > /dev/console
jffs2reset -y && reboot &
fi
return 0