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