Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37868805
en ru br
ALT Linux repos
S:0.4.3-alt1
5.0: 0.3-alt6.15
4.1: 0.3-alt6.15
4.0: 0.3-alt5.15
3.0: 0.3-alt1.14

Group :: Monitoring
RPM: hddtemp

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
# hddtemp Hard Drive Temperature Monitoring
#
# chkconfig: 345 90 10
# description: hddtemp polls SMART-capable HDDs
# processname: hddtemp
# pidfile: /var/run/hddtemp.pid

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

BINARY=/usr/sbin/hddtemp
LOCKFILE=/var/lock/subsys/hddtemp
DISKS="/dev/hd? /dev/sr? /dev/sg? /dev/sd?"
INTERFACE="127.0.0.1"
PORT="7634"
SEPARATOR="|"
RETVAL=0

# if overriding these is needed
SourceIfNotEmpty /etc/sysconfig/hddtemp

start()
{
for disk in $DISKS ; do
if $BINARY -n $OPTIONS $disk 2>/dev/null \
| /bin/grep -q '^[0-9]\+$'; then
DISKS_LIST="$DISKS_LIST $disk"
fi
done
if [ -n "$DISKS_LIST" ] ; then
start_daemon --lockfile "$LOCKFILE" --expect-user root -- \
hddtemp -d -l $INTERFACE -p $PORT -s $SEPARATOR \
$DISKS_LIST
else
echo " no disks with monitoring capability were found."
fi
RETVAL=$?
return $RETVAL
}

stop()
{
stop_daemon --lockfile "$LOCKFILE" --expect-user root -- hddtemp
RETVAL=$?
return $RETVAL
}

restart()
{
stop
start
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
restart
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
status --expect-user root -- hddtemp
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac

exit $RETVAL
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin