From 4425df33d1b79dc83de26473973884c6e17c1a31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 15 Nov 2006 15:59:02 +0000 Subject: [PATCH 1/1] - use functions Changed files: sensors_modules.init -> 1.3 --- sensors_modules.init | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) 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}" -- 2.44.0