SOURCES: apinger.init - use functions
blues
blues at pld-linux.org
Thu Aug 2 13:58:28 CEST 2007
Author: blues Date: Thu Aug 2 11:58:28 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- use functions
---- Files affected:
SOURCES:
apinger.init (1.9 -> 1.10)
---- Diffs:
================================================================
Index: SOURCES/apinger.init
diff -u SOURCES/apinger.init:1.9 SOURCES/apinger.init:1.10
--- SOURCES/apinger.init:1.9 Thu Dec 8 02:02:49 2005
+++ SOURCES/apinger.init Thu Aug 2 13:58:22 2007
@@ -15,11 +15,7 @@
# Get service config
[ -f /etc/sysconfig/apinger ] && . /etc/sysconfig/apinger
-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
- # Check if the service is already running?
+start() {
if [ ! -f /var/lock/subsys/apinger ]; then
msg_starting "Alarm Pinger"
daemon apinger
@@ -28,9 +24,9 @@
else
msg_already_running "Alarm Pinger"
fi
- ;;
- stop)
- # Stop daemons.
+}
+
+stop() {
if [ -f /var/lock/subsys/apinger ]; then
msg_stopping "Alarm Pinger"
killproc apinger
@@ -38,6 +34,15 @@
else
msg_not_running "Alarm Pinger"
fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
;;
status)
status apinger
@@ -54,8 +59,8 @@
fi
;;
restart)
- $0 stop
- $0 start
+ stop
+ start
exit $?
;;
*)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/apinger.init?r1=1.9&r2=1.10&f=u
More information about the pld-cvs-commit
mailing list