milis/ayarlar/servisler/mbd/init.d/hddtemp

38 lines
532 B
Plaintext
Raw Permalink Normal View History

2017-07-14 13:55:31 +02:00
#!/bin/sh
#
# /etc/rc.d/hddtemp: start/stop hddtemp daemon
#
# Check for configuration files
[ -f /etc/hddtemp.db ] || exit 1
case $1 in
start)
printf "Starting hddtemp..."
/usr/sbin/hddtemp -d -l 127.0.0.1 $(ls /dev/sd[a-z] | xargs)
if [ $? = 0 ]; then
printf " done.\n"
else
printf " error.\n"
fi
;;
stop)
printf "Shutting down hddtemp..."
killall -q /usr/sbin/hddtemp
printf " done.\n"
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "usage: $0 [start|stop|restart]"
exit 1
;;
esac
exit $?
# End of file