hddtemp.rc 532 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. #
  3. # /etc/rc.d/hddtemp: start/stop hddtemp daemon
  4. #
  5. # Check for configuration files
  6. [ -f /etc/hddtemp.db ] || exit 1
  7. case $1 in
  8. start)
  9. printf "Starting hddtemp..."
  10. /usr/sbin/hddtemp -d -l 127.0.0.1 $(ls /dev/sd[a-z] | xargs)
  11. if [ $? = 0 ]; then
  12. printf " done.\n"
  13. else
  14. printf " error.\n"
  15. fi
  16. ;;
  17. stop)
  18. printf "Shutting down hddtemp..."
  19. killall -q /usr/sbin/hddtemp
  20. printf " done.\n"
  21. ;;
  22. restart)
  23. $0 stop
  24. sleep 2
  25. $0 start
  26. ;;
  27. *)
  28. echo "usage: $0 [start|stop|restart]"
  29. exit 1
  30. ;;
  31. esac
  32. exit $?
  33. # End of file