[squid] added cache_swap.sh script

Jiri Skala jskala at fedoraproject.org
Wed Oct 26 06:49:39 UTC 2011


commit 38f9f03777883e32b56c3b6be46ac6d01a2e6bcc
Author: Jiri Skala <jskala at redhat.com>
Date:   Wed Oct 26 08:49:36 2011 +0200

    added cache_swap.sh script

 cache_swap.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/cache_swap.sh b/cache_swap.sh
new file mode 100644
index 0000000..b714e66
--- /dev/null
+++ b/cache_swap.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+if [ -f /etc/sysconfig/squid ]; then
+	. /etc/sysconfig/squid
+fi
+
+SQUID_CONF=${SQUID_CONF:-"/etc/squid/squid.conf"}
+
+CACHE_SWAP=`sed -e 's/#.*//g' $SQUID_CONF | \
+	grep cache_dir | awk '{ print $3 }'`
+
+for adir in $CACHE_SWAP; do
+	if [ ! -d $adir/00 ]; then
+		echo -n "init_cache_dir $adir... "
+		squid -z -F -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
+	fi
+done


More information about the scm-commits mailing list