#!/bin/sh
# Start/stop/restart the system logging daemons.
#
# Written for Slackware Linux by Patrick J. Volkerding <volkerdi@slackware.com>.

squid_start() {
  if [ -x /usr/sbin/squid ]; then
#    /usr/sbin/squid -m -u nobody -g nobody
    /usr/sbin/squid
  fi
}

squid_stop() {
  killall squid 2> /dev/null
}

squid_restart() {
  killall -9 squid
  sleep 1
  rm /usr/var/logs/squid.pid
  /usr/sbin/squid
}

case "$1" in
'start')
  squid_start
  ;;
'stop')
  squid_stop
  ;;
'restart')
  squid_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac
