diff --git a/sm5/smartd.initd.in b/sm5/smartd.initd.in index df3dd6ddea99c77d096cf75ea3bb7798abf916cc..f7aafd248ee8e940912c7bd90d4985031853d10b 100755 --- a/sm5/smartd.initd.in +++ b/sm5/smartd.initd.in @@ -2,7 +2,7 @@ # smartmontools init file for smartd # Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net> -# $Id: smartd.initd.in,v 1.23 2004/04/04 12:49:31 ballen4705 Exp $ +# $Id: smartd.initd.in,v 1.24 2004/04/30 20:03:23 chrfranke Exp $ # For RedHat and cousins: # chkconfig: 2345 40 40 @@ -341,6 +341,52 @@ elif uname -a | grep SunOS > /dev/null 2>&1 ; then esac exit 0 +elif uname | grep -i CYGWIN > /dev/null 2>&1 ; then + +# Source configuration file. This should define the shell variable smartd_opts. +# Email smartmontools-support@lists.sourceforge.net if there is a better choice +# of path for Cygwin + + [ -r /etc/sysconfig/smartmontools ] && . /etc/sysconfig/smartmontools + + PID_FILE=/var/run/smartd.pid + RETVAL=0 + + case "$1" in + start) + echo -n "Starting smartd: " + /usr/sbin/smartd -p $PID_FILE $smartd_opts + RETVAL=$? + ;; + stop) + echo -n "Shutting down smartd: " + [ -r $PID_FILE ] && kill `cat $PID_FILE` + RETVAL=$? + ;; + reload) + echo -n "Reloading smartd configuration: " + [ -r $PID_FILE ] && kill -HUP `cat $PID_FILE` + RETVAL=$? + ;; + report) + echo -n "Checking SMART devices now: " + [ -r $PID_FILE ] && kill -USR1 `cat $PID_FILE` + RETVAL=$? + ;; + restart) + $0 stop + sleep 1 + $0 start + exit $? + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|report}" + exit 1 + esac + + if [ "$RETVAL" -eq 0 ]; then echo "done"; else echo "ERROR"; fi + exit $RETVAL + # Add other OSes HERE, using elif... else report_unsupported "Unknown"