Last change
on this file since 3296 was
3296,
checked in by fenix, 12 years ago
|
Load Products.CacheSetup?-1.2.1 into vendor/Products.CacheSetup?/current.
|
-
Property svn:executable set to
*
|
File size:
1001 bytes
|
Line | |
---|
1 | PATH=/usr/bin:/sbin:/bin:/usr/sbin |
---|
2 | export PATH |
---|
3 | |
---|
4 | # determine the name of the squid binary |
---|
5 | [ -f /usr/sbin/squid ] && SQUID=squid |
---|
6 | [ -z "$SQUID" ] && exit 0 |
---|
7 | |
---|
8 | # determine which one is the cache_swap directory |
---|
9 | CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid/squid.conf | \ |
---|
10 | grep cache_dir | awk '{ print $3 }'` |
---|
11 | [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid |
---|
12 | |
---|
13 | echo $CACHE_SWAP |
---|
14 | echo $SQUID |
---|
15 | |
---|
16 | echo -n $"Stopping $SQUID: " |
---|
17 | $SQUID -k check >> /var/log/squid/squid.out 2>&1 |
---|
18 | RETVAL=$? |
---|
19 | |
---|
20 | if [ $RETVAL -eq 0 ] ; then |
---|
21 | $SQUID -k shutdown & |
---|
22 | rm -f /var/lock/subsys/$SQUID |
---|
23 | timeout=0 |
---|
24 | while : ; do |
---|
25 | [ -f /var/run/squid.pid ] || break |
---|
26 | if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then |
---|
27 | echo |
---|
28 | return 1 |
---|
29 | fi |
---|
30 | sleep 2 && echo -n "." |
---|
31 | timeout=$((timeout+2)) |
---|
32 | done |
---|
33 | echo "Stopped" |
---|
34 | #echo_success |
---|
35 | echo |
---|
36 | else |
---|
37 | echo "Not running" |
---|
38 | #echo_failure |
---|
39 | echo |
---|
40 | fi |
---|
41 | # return $RETVAL |
---|
42 | |
---|
43 | echo "Purging the cache" |
---|
44 | echo "" > $CACHE_SWAP/swap.state |
---|
45 | echo "Restarting squid" |
---|
46 | /etc/rc.d/init.d/squid start |
---|
Note: See
TracBrowser
for help on using the repository browser.