]> git.pld-linux.org Git - packages/squid.git/blobdiff - squid.init
- use functions
[packages/squid.git] / 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.030188 seconds and 4 git commands to generate.