Re: [SQU] Script

From: Tilman Schmidt <Tilman.Schmidt@dont-contact.us>
Date: Fri, 11 Aug 2000 17:29:48 +0200

At 14:59 11.08.00 +0200, MILIN Jacques wrote:
>is there anyone who have a script for squid in his /etc/init.d/squid ?
>My linux is a debian 2.1.
>
>I must already write
>/usr/local/squid/bin/squid -z

Why do you want to delete the entire contents of your cache each time
you reboot?

>/usr/local/squid/bin/RunCache &

That's all you really need for starting. But I prefer a script I
wrote myself which can also stop and reconfigure Squid properly:

--------8<--------8<--------8<--------8<--------8<--------8<--------
#!/bin/sh
#
# Start/stop Squid HTTP proxy server.
#

case "$1" in

'start')
        if [ -x /usr/local/squid/bin/squid ]; then
                echo "Starting Squid HTTP proxy/cache."
                su squid -c /usr/local/squid/bin/squid || exit 1
        fi
        ;;

'stop')
        echo "Shutting down Squid HTTP proxy/cache."
        /usr/local/squid/bin/squid -k shutdown

        countdown=60
        while /usr/local/squid/bin/squid -k check 2> /dev/null && [ $countdown -gt 0 ]
        do
                echo -ne "Waiting $countdown seconds for squid process to terminate...\r"
                sleep 1
                countdown=`expr $countdown - 1`
        done
        if [ $countdown -gt 0 ]
        then
                echo -e "\nSquid terminated."
        else
                echo -e "\nGiving up."
        fi
        ;;

'reload')
        echo "Reconfiguring Squid HTTP proxy/cache."
        /usr/local/squid/bin/squid -k reconfigure
        ;;

*)
        echo "Usage: $0 { start | stop | reload }"
        exit 1
        ;;

esac
exit 0
--------8<--------8<--------8<--------8<--------8<--------8<--------

-- 
Tilman Schmidt          E-Mail: Tilman.Schmidt@sema.de (office)
Sema Group Koeln, Germany       tilman@schmidt.bn.uunet.de (private)
Received on Fri Aug 11 2000 - 09:37:00 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:54:50 MST