🗃️ modified: bin/entrypoint-squid.sh 🗃️

This commit is contained in:
Jason 2022-02-16 19:05:31 -05:00
parent fb5ffd303e
commit 9e60f51e40
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F

View File

@ -22,7 +22,7 @@ __init() {
cp -Rf "/usr/local/share/squidFiles/$dir/." "/config/$dir/"
else
cp -Rf "/usr/local/share/squidFiles/data/." "/data/"
cp -Rf "usr/local/share/squidFiles/config/." "/config/"
cp -Rf "/usr/local/share/squidFiles/config/." "/config/"
fi
done
@ -58,6 +58,10 @@ __init() {
cp -Rf "/config/." "/etc/"
if [ "$(find /data/squidguard/db/* 2>/dev/null | wc -l)" -eq 0 ]; then
/usr/local/bin/create-blocklists.sh
fi
if [ "${UPDATE_BLACKLIST_URL}" != "" ]; then
sudo wget -O /tmp/backlist.tar.gz ${UPDATE_BLACKLIST_URL} &&
tar -xzf /tmp/backlist.tar.gz -C "/data/squidguard/db" &&
@ -75,10 +79,10 @@ __init() {
# allow arguments to be passed to squid
if [[ ${1:0:1} = '-' ]]; then
EXTRA_ARGS="$@"
EXTRA_ARGS=("$@")
set --
elif [[ ${1} == squid || ${1} == $(which squid) ]]; then
EXTRA_ARGS="${@:2}"
EXTRA_ARGS=("${@:2}")
set --
fi
}
@ -114,6 +118,7 @@ bash | shell | sh)
e2guardian -N -c "/config/e2guardian/e2guardian.conf" &
echo "Starting squid..."
exec $(which squid) -f "/config/squid/squid.conf" -NYCd 1 ${EXTRA_ARGS}
squid -f "/config/squid/squid.conf" -NYCd 1 ${EXTRA_ARGS} &
exec tail -f /data/log/*/*
;;
esac