]> git.sven.stormbind.net Git - sven/mpt-status.git/blobdiff - mpt-status.init
Add author and remove some cruft
[sven/mpt-status.git] / mpt-status.init
index 65b2e79bdccc9986b43e77b5aebf86a53adc36da..7e72bb0b5acc17aeb380253923c60a9a5454413d 100644 (file)
@@ -1,6 +1,7 @@
 #! /bin/sh
 
 # Author: Petter Reinholdtsen <pere@hungry.com>
+# Author: Sven Hoexter <sven@timegate.de>
 # License: GNU General Public License v2 or later
 
 # mpt-statusd - Check mpt-status values in the background.
@@ -47,10 +48,14 @@ if [ $RUN_DAEMON = "no" ] ; then
        exit 0
 fi
 
-#if ! [ -e "/proc/mpt/version" ] ; then
-#      log_failure_msg "The mptctl module is missing."
-#      exit 0
-#fi
+
+#Try to blindly load the mptctl module
+modprobe mptctl || true
+
+if ! [ -e "/proc/mpt/version" ] ; then
+       log_failure_msg "The mptctl module is missing."
+       exit 0
+fi
 
 check_mpt() {
     echo $$ > $PIDFILE.new && mv $PIDFILE.new $PIDFILE
@@ -161,7 +166,7 @@ d_stop() {
 # therefore can be used by a restart
 d_stop_by_restart() {
         if [ -f $PIDFILE ] ; then
-                killproc -p $PIDFILE $SCRIPTNAME > /dev/null 2>&1 
+                killproc -p $PIDFILE $SCRIPTNAME > /dev/null 2>&1
                 rm -f $PIDFILE
         else
                 log_warning_msg "Daemon is already stopped."
@@ -170,12 +175,11 @@ d_stop_by_restart() {
 
 case "$1" in
   start)
-        echo -n ""
         echo -n $"Starting $DESC: $NAME"
         d_start
         ;;
   stop)
-        log_begin_msg "Stopping $DESC: $NAME"
+        echo -n $"Stopping $DESC: $NAME"
         d_stop
         ;;
   check_mpt)