2011-10-26 06:49:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
if [ -f /etc/sysconfig/squid ]; then
|
|
|
|
. /etc/sysconfig/squid
|
|
|
|
fi
|
|
|
|
|
|
|
|
SQUID_CONF=${SQUID_CONF:-"/etc/squid/squid.conf"}
|
|
|
|
|
2019-12-17 13:28:48 +00:00
|
|
|
CACHE_SWAP=`grep '^[[:blank:]]*cache_dir' $SQUID_CONF | awk '{ print $3 }'`
|
2011-10-26 06:49:36 +00:00
|
|
|
|
2019-05-21 15:08:18 +00:00
|
|
|
init_cache_dirs=0
|
2011-10-26 06:49:36 +00:00
|
|
|
for adir in $CACHE_SWAP; do
|
|
|
|
if [ ! -d $adir/00 ]; then
|
|
|
|
echo -n "init_cache_dir $adir... "
|
2019-05-21 15:08:18 +00:00
|
|
|
init_cache_dirs=1
|
2011-10-26 06:49:36 +00:00
|
|
|
fi
|
|
|
|
done
|
2019-05-21 15:08:18 +00:00
|
|
|
|
|
|
|
if [ $init_cache_dirs -ne 0 ]; then
|
2019-05-22 15:26:03 +00:00
|
|
|
echo ""
|
2019-05-21 15:08:18 +00:00
|
|
|
squid --foreground -z -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
|
|
|
|
fi
|