X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=sensors_modules.init;h=b91eb0aa3370add7c61a2fa1a560b58f553fce80;hb=4425df33d1b79dc83de26473973884c6e17c1a31;hp=4a68dc7edd5984b2f253e8fd2f888d759631cecc;hpb=7909876dc7845d25826d88ea615eb79c55dbca43;p=packages%2Flm_sensors.git diff --git a/sensors_modules.init b/sensors_modules.init index 4a68dc7..b91eb0a 100644 --- a/sensors_modules.init +++ b/sensors_modules.init @@ -15,10 +15,7 @@ if [ -f /etc/sysconfig/sensors_modules ]; then . /etc/sysconfig/sensors_modules fi -RETVAL=0 -# See how we were called. -case "$1" in - start) +start() { # Check if the service is already running? if [ ! -f /var/lock/subsys/sensors_modules ]; then if [ -z "$BUS" ] || [ -z "$CHIP" ]; then @@ -42,8 +39,9 @@ case "$1" in else msg_already_running "sensors modules" fi - ;; - stop) +} + +stop() { if [ -f /var/lock/subsys/sensors_modules ]; then msg_stopping "sensors modules" @@ -59,14 +57,23 @@ case "$1" in else msg_not_running "sensors modules" fi +} + +RETVAL=0 +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop ;; status) sensors ;; restart|force-reload) - $0 stop - $0 start - exit $? + stop + start ;; *) msg_usage "$0 {start|stop|restart|force-reload|status}"