]> git.pld-linux.org Git - packages/squid.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 18 Sep 2007 12:01:31 +0000 (12:01 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    squid.init -> 1.41

squid.init

index 031f6dffde07ee935b0e117f474c16c7901d6ebb..2c0c72b28132454bbe9592bf691f9d17ce6bfaf2 100644 (file)
@@ -54,13 +54,7 @@ else
        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 @@ case "$1" in
        else
                msg_already_running Squid
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/squid ]; then
                # Stop daemons.
                msg_stopping Squid
@@ -103,11 +98,20 @@ case "$1" in
        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
This page took 0.167709 seconds and 4 git commands to generate.