Changeset 9433d2d in freewrt


Ignore:
Timestamp:
Jun 15, 2007, 5:33:22 PM (18 years ago)
Author:
Thorsten Glaser <tg@…>
Children:
27bc959
Parents:
a05cd00
Message:

simplify, thx nbd for the idea

git-svn-id: svn://www.freewrt.org/trunk/freewrt@2817 afb5a338-a214-0410-bd46-81f09a774fd1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package/base-files/files/etc/hotplug.d/button/reset

    ra05cd00 r9433d2d  
    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
Note: See TracChangeset for help on using the changeset viewer.