From 9e60f51e40ff9a0a17aacd8f2c594242d7c9db16 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 16 Feb 2022 19:05:31 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20modified:=20bin/entrypo?= =?UTF-8?q?int-squid.sh=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/entrypoint-squid.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/entrypoint-squid.sh b/bin/entrypoint-squid.sh index c8bda0e..87a9a32 100755 --- a/bin/entrypoint-squid.sh +++ b/bin/entrypoint-squid.sh @@ -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