Ignore:
Timestamp:
2010-05-13T02:52:08+02:00 (7 years ago)
Author:
nico
Message:

[packages] restorefactory: cleanup code (closes: #7327)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/utils/restorefactory/files/etc/hotplug.d/button/50-restorefactory

    r21090 r21440  
    1 # /bin/sh 
     1#!/bin/sh 
    22 
    33system_config() { 
    4         config_get button "$1" button "reset" 
     4        config_get button "$1" button "reset" 
    55        config_get action "$1" action "pressed" 
    6         config_get timeout "$1" timeout "5"    
     6        config_get timeout "$1" timeout "5" 
    77} 
    88 
     
    1414        [ -f /tmp/run/restorefactory.pid ] && read PID < /tmp/run/restorefactory.pid && kill $PID && rm /tmp/run/restorefactory.pid && logger -p user.info -t "restorefactory" "restore to factory defaults aborted" 
    1515 
    16         [ "$ACTION" = "$action" ] && { 
     16        [ "$ACTION" = "$action" ] && { 
    1717 
    18                 if [ "$timeout" -gt 0 ] 
     18                if [ "$timeout" -gt 0 ] 
    1919                then 
    2020                        sleep "$timeout" && firstboot && reboot & 
    21                         echo $! > /tmp/run/restorefactory.pid 
    22                         logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds" 
     21                        echo $! > /tmp/run/restorefactory.pid 
     22                        logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds" 
    2323                elif [ "$timeout" -eq 0 ] 
    24                 then             
     24                then 
    2525                        firstboot && reboot & 
    2626                else 
    2727                        logger -p user.info -t "restorefactory" "invalid timeout value ($timeout)" 
    2828                fi 
    29         } 
     29        } 
    3030}  
    3131 
Note: See TracChangeset for help on using the changeset viewer.