Skip to content
Snippets Groups Projects
Commit 71455ea8 authored by chrfranke's avatar chrfranke
Browse files

Added Cygwin section

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@1698 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 0937ec65
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment