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