SOURCES: openntpd.init - use functions
glen
glen at pld-linux.org
Mon Aug 27 21:51:46 CEST 2007
Author: glen Date: Mon Aug 27 19:51:46 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- use functions
---- Files affected:
SOURCES:
openntpd.init (1.6 -> 1.7)
---- Diffs:
================================================================
Index: SOURCES/openntpd.init
diff -u SOURCES/openntpd.init:1.6 SOURCES/openntpd.init:1.7
--- SOURCES/openntpd.init:1.6 Thu Dec 8 01:41:26 2005
+++ SOURCES/openntpd.init Mon Aug 27 21:51:40 2007
@@ -25,10 +25,7 @@
exit 0
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/ntpd ]; then
msg_starting ntpd
@@ -38,8 +35,9 @@
else
msg_already_running ntpd
fi
- ;;
- stop)
+}
+
+stop() {
if [ -f /var/lock/subsys/ntpd ]; then
msg_stopping ntpd
killproc ntpd
@@ -47,15 +45,24 @@
else
msg_not_running ntpd
fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
;;
status)
status ntpd
exit $?
;;
restart|force-reload)
- $0 stop
- $0 start
- exit $?
+ stop
+ start
;;
*)
msg_usage "$0 {start|stop|restart|force-reload|status}"
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/openntpd.init?r1=1.6&r2=1.7&f=u
More information about the pld-cvs-commit
mailing list