From 71455ea82ba66f277f23b26acd6890b63428ac54 Mon Sep 17 00:00:00 2001 From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Fri, 30 Apr 2004 20:03:23 +0000 Subject: [PATCH] Added Cygwin section git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@1698 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- sm5/smartd.initd.in | 48 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/sm5/smartd.initd.in b/sm5/smartd.initd.in index df3dd6dde..f7aafd248 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" -- GitLab