#!/bin/sh
#
# squid.init   This shell script takes care of starting and stopping
#              squid
#

# Source function library.
. /etc/rc.d/init.d/functions

SQUID_HOME=/usr

[ -f $SQUID_HOME/bin/squid ] || exit 0

case "$1" in
  start)
     echo -n "Starting squid: "
     daemon exec $SQUID_HOME/bin/RunCache &
     echo
     touch /var/lock/subsys/squid
     ;;
  stop)
     echo -n "Shutting down squid"

     set dummy `ps auwx | grep RunCache | grep -v grep`
     shift; shift
     test $# -gt 0 && kill $1
     $SQUID_HOME/bin/squid -k shutdown
     echo
     rm -f /var/lock/subsys/squid
     ;;
  *)
     echo "Usage: squid.init {start|stop}"
     exit 1
esac

exit 0
