3 CONFPATH
="/etc/spindown.conf"
4 VARDIR
="/var/run/spindown"
5 FIFOPATH
="${VARDIR}/spindownd.fifo"
6 PIDFILE
="${VARDIR}/spindownd.pid"
11 #prints table with status about the disks
13 #print the header of the table
14 printf "%-5s %10s %10s %15s %20s\n" name watched active idle-time spindown-time
18 printf "%-5s %10s %10s %15s %20s\n" $line
25 PID
=$
(pidof
-o %PPID
/sbin
/spindownd
)
28 stat_busy
"Starting disk spindown daemon"
29 [ ! -d ${VARDIR} ] && mkdir
-p ${VARDIR} &> /dev
/null
30 [ -z "${PID}" ] && /sbin/spindownd -d -f ${FIFOPATH} -c ${CONFPATH} -p ${PIDFILE}
39 stat_busy "Stopping disk spindown daemon
"
40 [ -f "${PIDFILE}" ] && kill $(cat ${PIDFILE}) &>/dev/null
49 [ -z "${PID}" ] && exit 1
62 echo "usage
: $0 {start|stop|restart|status
}"