summaryrefslogtreecommitdiff
path: root/network/squid/rc.squid.new
diff options
context:
space:
mode:
authorDavid Somero <dsomero@hotmail.com>2010-05-13 00:38:21 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-13 00:38:21 +0200
commit7f829d9a90c85e05bf6d93a9fbc4ace0fe99297d (patch)
tree5d4037b2af781951c3911c96074020abcbafd1a0 /network/squid/rc.squid.new
parent0b3f8d9c4c0a336b1834b7cbd22af0b350fe5e59 (diff)
downloadslackbuilds-7f829d9a90c85e05bf6d93a9fbc4ace0fe99297d.tar.gz
network/squid: Updated for version 3.0.STABLE21
Diffstat (limited to 'network/squid/rc.squid.new')
-rw-r--r--network/squid/rc.squid.new83
1 files changed, 0 insertions, 83 deletions
diff --git a/network/squid/rc.squid.new b/network/squid/rc.squid.new
deleted file mode 100644
index 4810dae64f..0000000000
--- a/network/squid/rc.squid.new
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-# Start/stop/restart/reload the Squid Internet Object Cache (squid)
-# To make Squid start automatically at boot, make this
-# file executable: chmod 755 /etc/rc.d/rc.Squid
-#
-# Written for Slackware Linux by Erik Jan Tromp
-# Modified by David Somero <xgizzmo@slackbuilds.org>
-
-SQUIDCFG=/etc/squid/squid.conf
-SQUIDCMD=/usr/sbin/squid
-
-if [ ! -r $SQUIDCFG ]; then
- echo "Please set the correct path to $SQUIDCFG"
- exit 1
-fi
-
-if [ ! -x $SQUIDCMD ]; then
- echo "$SQUIDCMD not found"
- exit 1
-fi
-
-squid_start() {
- # Create cache directory hierarchy if needed
- ALL_DIRS=$(awk '/^cache_dir/ {print $3}' $SQUIDCFG)
- [ -z "$ALL_DIRS" ] && ALL_DIRS=/var/cache/squid
-
- for CACHE_DIR in $ALL_DIRS ; do
- if [ ! -d $CACHE_DIR/00 ] ; then
- echo "Creating swap directories: $SQUIDCMD -z"
- $SQUIDCMD -z 2> /dev/null
- break
- fi
- done
-
- echo "Starting Squid: $SQUIDCMD -DF"
- $SQUIDCMD -DF
-}
-
-squid_stop() {
- COUNTDOWN=$(awk '/^shutdown_lifetime/ {print $2}' $SQUIDCFG)
- [ -z "$COUNTDOWN" ] && COUNTDOWN=30
-
- echo -n "Shutting down Squid in $COUNTDOWN seconds: "
- $SQUIDCMD -k shutdown 2> /dev/null
- while $SQUIDCMD -k check 2> /dev/null ; do
- sleep 1
- echo -n .
- COUNTDOWN=$[ $COUNTDOWN - 1 ]
- if [ $COUNTDOWN -le 0 ] ; then
- $SQUIDCMD -k interrupt 2> /dev/null
- sleep 1
- break
- fi
- done
- echo
-}
-
-squid_restart() {
- squid_stop
- sleep 1
- squid_start
-}
-
-squid_reload() {
- $SQUIDCMD -k reconfigure 2> /dev/null
-}
-
-case "$1" in
-'start')
- squid_start
- ;;
-'stop')
- squid_stop
- ;;
-'restart')
- squid_restart
- ;;
-'reload')
- squid_reload
- ;;
-*)
- echo "usage: $0 start|stop|restart|reload"
-esac