]> git.pld-linux.org Git - packages/squid.git/blob - squid.init
- startup variable now in /etc/sysconfig/squid
[packages/squid.git] / squid.init
1 #!/bin/bash
2 # squid         This shell script takes care of starting and stopping
3 #               Squid Internet Object Cache
4 #
5 # chkconfig: 345 90 25
6 # description: Squid - Internet Object Cache. Internet object caching is \
7 #       a way to store requested Internet objects (i.e., data available \
8 #       via the HTTP, FTP, and gopher protocols) on a system closer to the \
9 #       requesting site than to the source. Web browsers can then use the \
10 #       local Squid cache as a proxy HTTP server, reducing access time as \
11 #       well as bandwidth consumption.
12 # pidfile: /var/run/squid.pid
13 # config: /etc/squid/squid.conf
14
15 # Source function library.
16 . /etc/rc.d/init.d/functions
17
18 # Source networking configuration.
19 . /etc/sysconfig/network
20
21 # Check that networking is up.
22 [ "${NETWORKING}" = "no" ] && exit 0
23
24 # check if the squid conf file is present
25 [ -f /etc/squid/squid.conf ] || exit 0
26
27 # Load startup variables
28 . /etc/sysconfig/squid
29
30 case "$1" in
31 start)
32     show Starting squid
33     if [ ! -d $CACHE_SWAP/00 ]; then
34     squid -z -F &>/dev/null
35     fi
36     daemon $NICELEVEL squid $SQUID_OPTS 
37     touch /var/lock/subsys/squid
38     ;;
39 stop)
40     show Stopping squid
41     killproc squid  
42     rm -f /var/lock/subsys/squid
43     ;;
44 restart)
45     $0 stop
46     $0 start
47     ;;
48 status)
49     status squid
50     ;;
51 *)
52     echo "Usage: $0 {start|stop|status|restart}"
53     exit 1
54 esac
55
56 exit 0
This page took 0.056836 seconds and 4 git commands to generate.