2006-02-23 16:26:10 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# /etc/rc.d/squid: start/stop squid daemon
|
|
|
|
#
|
|
|
|
|
2015-02-19 11:12:24 +01:00
|
|
|
SSD=/sbin/start-stop-daemon
|
|
|
|
PROG=/usr/sbin/squid
|
|
|
|
PID=/var/run/squid.pid
|
|
|
|
OPTS="-Y"
|
2012-10-07 10:46:02 +02:00
|
|
|
|
2006-02-23 16:26:10 +01:00
|
|
|
case $1 in
|
|
|
|
start)
|
2015-02-19 11:12:24 +01:00
|
|
|
$SSD --start --pidfile $PID --exec $PROG -- $OPTS
|
2006-02-23 16:26:10 +01:00
|
|
|
;;
|
|
|
|
stop)
|
2015-02-19 11:12:24 +01:00
|
|
|
$SSD --stop --retry 10 --pidfile $PID --signal INT
|
2012-09-20 10:43:57 +02:00
|
|
|
;;
|
|
|
|
shutdown)
|
2015-02-19 11:12:24 +01:00
|
|
|
$SSD --stop --retry 60 --pidfile $PID --signal TERM
|
2006-02-23 16:26:10 +01:00
|
|
|
;;
|
2012-09-20 10:43:57 +02:00
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
;;
|
2015-02-19 11:12:24 +01:00
|
|
|
reload)
|
|
|
|
$SSD --stop --pidfile $PID --signal HUP
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
$SSD --status --pidfile $PID
|
|
|
|
case $? in
|
2015-04-03 12:01:43 +02:00
|
|
|
0) echo "$PROG is running with pid $(cat $PID)" ;;
|
2015-02-19 11:12:24 +01:00
|
|
|
1) echo "$PROG is not running but the pid file $PID exists" ;;
|
|
|
|
3) echo "$PROG is not running" ;;
|
|
|
|
4) echo "Unable to determine the program status" ;;
|
|
|
|
esac
|
|
|
|
;;
|
2006-02-23 16:26:10 +01:00
|
|
|
*)
|
2015-02-19 11:12:24 +01:00
|
|
|
echo "usage: $0 [start|stop|shutdown|restart|reload|status]"
|
2006-02-23 16:26:10 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# End of file
|