# HG changeset patch # User Eric Joseph-Alexandre # Date 1236634543 -3600 # Node ID f75355f3437e25c0865e2583dbeb2ddecbea1ff5 # Parent aecb1ba84c8330b72b8f48bc630c87b9e8136cc8 squid: Add reload command. Use squid to start/stop daemon. diff -r aecb1ba84c83 -r f75355f3437e squid/stuff/etc/init.d/squid --- a/squid/stuff/etc/init.d/squid Mon Mar 09 20:19:06 2009 +0100 +++ b/squid/stuff/etc/init.d/squid Mon Mar 09 22:35:43 2009 +0100 @@ -27,7 +27,7 @@ [ -n "$cache_dir" ] || cache_dir=/var/cache if [ -d "$cache_dir" -a ! -d "$cache_dir/00" ]; then echo -n "Creating squid spool directory structure" - $DAEMON -z + $DAEMON -z > /dev/null 2>&1 status fi echo -n "Starting $DESC: $NAME... " @@ -41,25 +41,33 @@ exit 1 fi echo -n "Stopping $DESC: $NAME... " - kill `cat $PIDFILE` + $DAEMON -k kill status + rm -f $PIDFILE sleep 2 ;; + reload) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Reloading $DESC configuration... " + $DAEMON -k reconfigure + status + ;; restart) if [ ! -f $PIDFILE ] ; then echo "$NAME is not running." exit 1 fi echo -n "Restarting $DESC: $NAME... " - kill `cat $PIDFILE` - sleep 2 - $DAEMON $OPTIONS + $DAEMON -k kill && $DAEMON $OPTIONS status sleep 2 ;; *) echo "" - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|reload|restart]" echo "" exit 1 ;;