|
Lines 1-25
Link Here
|
| 1 |
#!/bin/sh |
1 |
#!/bin/sh |
| 2 |
|
2 |
|
| 3 |
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then |
|
|
| 4 |
echo "$0: Cannot determine the PREFIX" >&2 |
| 5 |
exit 1 |
| 6 |
fi |
| 7 |
|
| 8 |
case "$1" in |
3 |
case "$1" in |
| 9 |
start) |
4 |
start) |
| 10 |
if [ -x ${PREFIX}/sbin/squid -a -f ${PREFIX}/etc/squid/squid.conf ]; then |
5 |
if [ -x %%PREFIX%%/sbin/squid -a -f %%PREFIX%%/etc/squid/squid.conf ]; then |
| 11 |
(cd /${PREFIX}/squid/logs; ${PREFIX}/sbin/squid >/dev/null 2>&1 &) ; echo -n ' squid' |
6 |
(cd /%%PREFIX%%/squid/logs; %%PREFIX%%/sbin/squid >/dev/null 2>&1 &) ; echo -n ' squid' |
| 12 |
fi |
7 |
fi |
| 13 |
;; |
8 |
;; |
| 14 |
stop) |
9 |
stop) |
| 15 |
${PREFIX}/sbin/squid -k shutdown 2>&1 |
10 |
%%PREFIX%%/sbin/squid -k shutdown 2>&1 |
| 16 |
# Uncomment this if you'd like the system to (attempt to |
11 |
# Uncomment this if you'd like the system to (attempt to |
| 17 |
# wait for) squid to shut down cleanly |
12 |
# wait for) squid to shut down cleanly |
| 18 |
#echo "Sleeping for 45 seconds to allow squid to shutdown.." |
13 |
#echo "Sleeping for 45 seconds to allow squid to shutdown.." |
| 19 |
#sleep 45 |
14 |
#sleep 45 |
| 20 |
;; |
15 |
;; |
|
|
16 |
restart) |
| 17 |
%%PREFIX%%/sbin/squid -k reconfigure |
| 18 |
;; |
| 21 |
*) |
19 |
*) |
| 22 |
echo "Usage: `basename $0` {start|stop}" >&2 |
20 |
echo "Usage: `basename $0` {start|stop|restart}" >&2 |
| 23 |
;; |
21 |
;; |
| 24 |
esac |
22 |
esac |