Changeset 2817

Show
Ignore:
Timestamp:
06/15/07 17:33:22 (1 year ago)
Author:
tg
Message:

simplify, thx nbd for the idea

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/package/base-files/files/etc/hotplug.d/button/reset

    r2816 r2817  
    1 # default action: reboot forcibly if RESET button pressed for >4 seconds 
     1# default action: reboot forcibly if RESET button pressed for four seconds 
    22case $BUTTON:$ACTION in 
    33reset:pressed) 
    4         date +%s >/tmp/.reset-button.pressed 
     4        true >/tmp/.reset-button.pressed 
    55        ;; 
    66reset:released) 
    7         dst=$(cat /tmp/.reset-button.pressed 2>&-) 
    8         if test 0 -lt "$dst"; then 
    9                 dst=$(expr $(date +%s) - $dst) 
    10                 test 4 -lt "$dst" && /bin/busybox reboot -f 
    11         fi 
     7        test -e /tmp/.reset-button.pressed && \ 
     8            test 4 -le "$SEEN" && /bin/busybox reboot -f 
    129        rm -f /tmp/.reset-button.pressed 
    1310        ;; 
    1411*) 
    15         rm -f /tmp/.reset-button.pressed       # cancel in-progress reset 
     12        rm -f /tmp/.reset-button.pressed 
    1613        ;; 
    1714esac