6 PID
=$
(pidof
-o %PPID
/usr
/sbin
/autopoweroffd
)
7 LOG
=/var
/log
/autopoweroff.log
11 stat_busy
"Starting Autopoweroff Daemon"
12 [[ -z $PID ]] && /usr
/sbin
/autopoweroffd
>> $LOG 2>&1
13 if [[ $?
-gt 0 ]]; then
16 add_daemon autopoweroff
21 stat_busy
"Stopping Autopoweroff Daemon"
22 [[ -n $PID ]] && kill $PID &> $LOG
24 if [[ $?
-gt 0 ]]; then
27 rm_daemon autopoweroff
37 echo "usage: $0 {start|stop|restart}"