]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/squid
Enabled force setting system time on boot.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / squid
index 4930548539ea318cc0c8c10e92f92ece09852f33..35ad8a87ad5a324d42f4df58a16d719d9c8a395d 100644 (file)
@@ -47,9 +47,16 @@ transparent() {
 
 case "$1" in
        start)
-               boot_mesg "Starting Squid Proxy Server..."
-               
+               getpids "squid"
+
+               if [ -n "${pidlist}" ]; then
+                       echo -e "Squid is already running with Process"\
+                               "ID(s) ${pidlist}.${NORMAL}"
+               evaluate_retval
+               exit
+               fi
                if [ -e /var/ipfire/proxy/enable -o -e /var/ipfire/proxy/enable_blue ]; then
+                       boot_mesg "Starting Squid Proxy Server..."
                        loadproc /usr/sbin/squid -D -z >/dev/null 2>&1
                        loadproc /usr/sbin/squid -D
                fi
@@ -65,20 +72,28 @@ case "$1" in
                ;;
 
        stop)
-               boot_mesg "Stopping Squid Proxy Server..."
-               iptables -t nat -F SQUID
-               squid -k shutdown >/dev/null 2>&1
-               evaluate_retval
-               killproc /usr/sbin/squid >/dev/null
-               killproc /usr/bin/squidGuard >/dev/null
+                       iptables -t nat -F SQUID
+               if [ -e /var/run/squid.pid ]; then
+                       boot_mesg "Stopping Squid Proxy Server..."
+                       squid -k shutdown >/dev/null 2>&1
+                       evaluate_retval
+                       killproc /usr/bin/squidGuard >/dev/null
+                       killproc /usr/sbin/updxlrator >/dev/null
+                       killproc /usr/sbin/squid >/dev/null
+                       rm -rf /var/run/squid.pid       
+               fi
                ;;
 
        restart)
                $0 stop
-               sleep 1
+               sleep 5
                $0 start
                ;;
 
+       reconfigure)
+       /usr/sbin/squid -k reconfigure
+               ;;
+
        status)
                statusproc /usr/sbin/squid
                statusproc /usr/lib/squid/unlinkd
@@ -91,6 +106,9 @@ case "$1" in
                sleep 1
                $0 start
                ;;
+       setperms)
+               chown -R nobody.squid /var/updatecache/
+               ;;
 
        *)
                echo "Usage: $0 {start|stop|restart|status|flush}"