blob: 2403122ad21d1abd568337908c9d58060e87bf08 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh
2
3. /lib/functions.sh
4
5OVERLAY="$( grep ' /overlay ' /proc/mounts )"
6
7case "$ACTION" in
8pressed)
9 [ -z "$OVERLAY" ] && return 0
10
11 return 5
12;;
13timeout)
14 . /etc/diag.sh
15 set_state failsafe
16;;
17released)
18 if [ "$SEEN" -lt 1 ]
19 then
20 echo "REBOOT" > /dev/console
21 sync
22 reboot
23 elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ]
24 then
25 echo "FACTORY RESET" > /dev/console
26 jffs2reset -y && reboot &
27 fi
28;;
29esac
30
31return 0