2020-05-06 12:53:16 +00:00
|
|
|
#!/bin/bash
|
|
|
|
if [ -f /etc/sysconfig/squid ]; then
|
|
|
|
. /etc/sysconfig/squid
|
|
|
|
fi
|
|
|
|
|
|
|
|
SQUID_CONF=${SQUID_CONF:-"/etc/squid/squid.conf"}
|
|
|
|
|
2024-11-20 13:33:06 +00:00
|
|
|
CACHE_SWAP=`awk '/^[[:blank:]]*cache_dir/ { print $3 }' "$SQUID_CONF"`
|
2020-05-06 12:53:16 +00:00
|
|
|
|
2024-11-20 13:33:06 +00:00
|
|
|
init_cache_dirs=0
|
2020-05-06 12:53:16 +00:00
|
|
|
for adir in $CACHE_SWAP; do
|
|
|
|
if [ ! -d $adir/00 ]; then
|
|
|
|
echo -n "init_cache_dir $adir... "
|
2024-11-20 13:33:06 +00:00
|
|
|
init_cache_dirs=1
|
2020-05-06 12:53:16 +00:00
|
|
|
fi
|
|
|
|
done
|
2024-11-20 13:33:06 +00:00
|
|
|
|
|
|
|
if [ $init_cache_dirs -ne 0 ]; then
|
|
|
|
echo ""
|
|
|
|
squid --foreground -z -f "$SQUID_CONF" >> /var/log/squid/squid.out 2>&1
|
|
|
|
fi
|