]> git.pld-linux.org Git - packages/lm_sensors.git/blobdiff - sensors.init
- rel 4
[packages/lm_sensors.git] / sensors.init
index 30d56add83e959f59516fd9733337d1480296617..80f36dab1c790eccc36b3a852bd13cfc9e4e0866 100644 (file)
 . /etc/rc.d/init.d/functions
 
 # Get service config
-if [ -f /etc/sysconfig/sensors ] ; then
+if [ -f /etc/sysconfig/sensors ]; then
        . /etc/sysconfig/sensors
 fi
 
-
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/sensors ]; then
-               msg_starting "sensors daemon"
                if [ -z "$BUS" ] || [ -z "$CHIP" ]; then 
-                       fail
-                       nls "BUS or CHIP not configured in /etc/sysconfig/sensors"
-                       exit 1
+                       msg_starting "sensors daemon"; fail
+                       nls "BUS or CHIP not configured in /etc/sysconfig/sensors" >&2
+                       exit 6
                fi
 
                # insert modules
@@ -41,6 +40,7 @@ case "$1" in
                        sensors -s
                fi
 
+               msg_starting "sensors daemon"
                daemon sensord \
                        $([ -n "$INTERVAL" ] && echo "-i $INTERVAL") \
                        $([ -n "$LOG_INTERVAL" ] && echo "-l $LOG_INTERVAL") \
@@ -53,7 +53,6 @@ case "$1" in
                touch /var/lock/subsys/sensors
        else
                msg_already_running "sensors daemon"
-               exit 1
        fi
        ;;
   stop)
@@ -72,24 +71,21 @@ case "$1" in
                rm -f /var/lock/subsys/sensors
        else
                msg_not_running "sensors daemon"
-               exit 1
        fi
        ;;
   status)
        status sensors sensord
+       RETVAL=$?
        sensors
        ;;
-  restart|reload)
+  restart|force-reload)
        $0 stop
        $0 start
-       ;;
-  force-reload)
-       $0 stop && $0 start
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
-       exit 1
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
 esac
 
 exit $RETVAL
This page took 0.191009 seconds and 4 git commands to generate.