diff options
author | hubertf <hubertf> | 2000-12-16 09:45:44 +0000 |
---|---|---|
committer | hubertf <hubertf> | 2000-12-16 09:45:44 +0000 |
commit | b3ec2601eae1c34a5a2da831dcfcb5e8f51c41e3 (patch) | |
tree | 303eeb45e80defaa3d281c3bfc4b811848554a9e /www | |
parent | de276c6eef87687c26713622c1c0240de45e2f6d (diff) | |
download | pkgsrc-b3ec2601eae1c34a5a2da831dcfcb5e8f51c41e3.tar.gz |
Make this fit our rc.d start/stop scheme
Diffstat (limited to 'www')
-rw-r--r-- | www/squid/files/squid.sh | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/www/squid/files/squid.sh b/www/squid/files/squid.sh index a904ce29d67..4ad5039e018 100644 --- a/www/squid/files/squid.sh +++ b/www/squid/files/squid.sh @@ -1,10 +1,34 @@ #!/bin/sh # -# $NetBSD: squid.sh,v 1.3 1998/12/06 12:42:00 tron Exp $ +# $NetBSD: squid.sh,v 1.4 2000/12/16 09:45:44 hubertf Exp $ # -if [ -x @PREFIX@/sbin/RunCache -a -f /etc/squid.conf ]; -then - @PREFIX@/sbin/RunCache >/dev/null 2>&1 & - echo -n ' squid' -fi -exit 0 + +case $1 in +start) + if [ `ps -auxwww | grep RunCache | grep -v grep | wc -l'` -ne 0 ]; then + echo "squid already running." + exit 1 + fi + + if [ -x @PREFIX@/sbin/RunCache -a -f /etc/squid.conf ]; + then + @PREFIX@/sbin/RunCache >/dev/null 2>&1 & + echo -n ' squid' + fi + ;; +stop) + if [ `ps -auxwww | grep RunCache | grep -v grep | wc -l'` -ne 0 ]; then + kill `ps -auxwww | grep RunCache | awk '{print $2}'` + @PREFIX@/sbin/squid -k shutdown + else + echo "squid not running." + fi + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac |