reset 323 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. . /lib/functions.sh
  3. case "$ACTION" in
  4. pressed)
  5. return 5
  6. ;;
  7. timeout)
  8. . /etc/diag.sh
  9. set_state failsafe
  10. ;;
  11. released)
  12. if [ "$SEEN" -lt 1 ]
  13. then
  14. echo "REBOOT" > /dev/console
  15. sync
  16. reboot
  17. elif [ "$SEEN" -gt 5 ]
  18. then
  19. echo "FACTORY RESET" > /dev/console
  20. jffs2reset -y && reboot &
  21. fi
  22. ;;
  23. esac
  24. return 0