[ pressed != "$ACTION" -o reset != "$BUTTON" ] 

# where we're going, we don't need no hotplug events anymore :)
echo /bin/true > /proc/sys/kernel/hotplug

# ppp likes it if the connection is terminated properly
ifdown wan

# XXX: we have to do this crappy workaround, because edge detect
# on the reset gpio line is fucked up.
reset="$(($(grep ar531x_reset /proc/interrupts | awk -F: '{print $1}') - 0x30))"
c=0
while [ "$c" -lt 5 ]; do
	sleep 1
	
	# reset button still pressed?
	[ 1 = "$(cat /proc/gpio/${reset}_in)" ] || {
		reboot
		exit
	}
	
	c="$(($c + 1))"
done

. /etc/functions.sh
jffs2_mark_erase rootfs_data
reboot
