All pastes #3135 Raw Edit

squid

public text v1 · immutable
#3135 ·published 2004-12-18 04:04 UTC
rendered paste body
#!/bin/bash
#
# Startup script for Squid
#
# chkconfig: 2345 80 30
#
# processname: Squid

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

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
        exit 0
fi

# [ -f /usr/bin/FOOBAR -o -f /usr/local/bin/FOOBAR ] || exit 0

# See how we were called.
case "$1" in
  start)
        gprintf "Starting Squid: "
        daemon /usr/local/squid/sbin/squid -d 1
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/Squid
        ;;
  stop)
        gprintf "Shutting down Squid: "
        killproc Squid
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/Squid
        ;;
  status)
        status Squid
        RETVAL=$?
        ;;
  restart)
        $0 stop
        $0 start
        RETVAL=$?
        ;;
  reload)
        gprintf "Re-reading Squid config: "
        killproc Squid -HUP
        RETVAL=$?
        echo
        ;;
  *)
        gprintf "Usage: %s {start|stop|status|restart|reload}\n" "$0"
        exit 1
esac

exit 0