SHA256
1
0
forked from pool/squid
squid/initialize_cache_if_needed.sh
Martin Pluskal a86b838f19 Accepting request 482004 from server:proxy:Test
- initialize_cache_if_needed.sh, squid_dir.sed: Initialize cache
  directory on startup if it is missing. Move scripts out of
  systemd service file and into individual files. (bnc#1030421)

OBS-URL: https://build.opensuse.org/request/show/482004
OBS-URL: https://build.opensuse.org/package/show/server:proxy/squid?expand=0&rev=117
2017-03-22 15:16:54 +00:00

14 lines
274 B
Bash

#!/bin/sh
DIR=$(dirname $0)
CACHE_DIR=$($DIR/cache_dir.sed < /etc/squid/squid.conf)
if [ 'x'$CACHE_DIR = 'x' ]; then
exit 0
fi
if ! test -d $CACHE_DIR; then
echo "Initializing cache directories..."
exec /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf
fi