SOURCES: squid.init - use functions
glen
glen at pld-linux.org
Tue Sep 18 14:01:36 CEST 2007
Author: glen Date: Tue Sep 18 12:01:36 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- use functions
---- Files affected:
SOURCES:
squid.init (1.40 -> 1.41)
---- Diffs:
================================================================
Index: SOURCES/squid.init
diff -u SOURCES/squid.init:1.40 SOURCES/squid.init:1.41
--- SOURCES/squid.init:1.40 Fri Mar 3 22:21:36 2006
+++ SOURCES/squid.init Tue Sep 18 14:01:31 2007
@@ -54,13 +54,7 @@
exit 0
fi
-# Sanity check
-[ -f /etc/squid/squid.conf ] || exit 0
-
-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
+start() {
# Check if the service is already running?
if [ ! -f /var/lock/subsys/squid ]; then
msg_starting Squid
@@ -70,8 +64,9 @@
else
msg_already_running Squid
fi
- ;;
- stop)
+}
+
+stop() {
if [ -f /var/lock/subsys/squid ]; then
# Stop daemons.
msg_stopping Squid
@@ -103,11 +98,20 @@
else
msg_not_running Squid
fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
;;
restart)
- $0 stop
- $0 start
- exit $?
+ stop
+ start
;;
reload|force-reload)
if [ -f /var/lock/subsys/squid ]; then
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/squid.init?r1=1.40&r2=1.41&f=u
More information about the pld-cvs-commit
mailing list