From 415856bdd4f48ab4f2732996f0bae58595092bbe Mon Sep 17 00:00:00 2001 From: Parabola Date: Tue, 5 Apr 2011 14:26:38 +0000 Subject: Tue Apr 5 14:26:38 UTC 2011 --- extra/smartmontools/smartd.rc | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 extra/smartmontools/smartd.rc (limited to 'extra/smartmontools/smartd.rc') diff --git a/extra/smartmontools/smartd.rc b/extra/smartmontools/smartd.rc new file mode 100755 index 000000000..16920db12 --- /dev/null +++ b/extra/smartmontools/smartd.rc @@ -0,0 +1,39 @@ +#!/bin/bash + +# source application-specific settings +SMARTD_ARGS= +[ -f /etc/conf.d/smartd ] && . /etc/conf.d/smartd + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + + start) + stat_busy "Starting smartd" + /usr/sbin/smartd ${SMARTD_ARGS} &>/dev/null + if [ $? -ne 0 ]; then + stat_fail + else + add_daemon smartd + stat_done + fi + ;; + + stop) + stat_busy "Stopping smartd" + kill -9 `pidof /usr/sbin/smartd` &>/dev/null + rm_daemon smartd + stat_done + ;; + + restart) + stat_busy "Restarting smartd ..." + $0 stop + $0 start + stat_done + ;; + + *) + echo "usage: $0 {start|stop|restart}" +esac -- cgit v1.2.3-54-g00ecf