From e72e1a4cb63af7c2cc8fc673cffd2dbfd091e3b8 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 17 Feb 2022 09:57:06 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20modified:=20bin/create-?= =?UTF-8?q?blocklists.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/create-blocklists.sh | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/bin/create-blocklists.sh b/bin/create-blocklists.sh index 91d2d28..53cc2ad 100755 --- a/bin/create-blocklists.sh +++ b/bin/create-blocklists.sh @@ -2,7 +2,7 @@ SQUID_USER="${SQUID_USER:-squid}" SQUID_LOG_DIR="${SQUID_LOG_DIR:-/data/log/squid}" -REDIRECT_URL="${REDIRECT_URL:-/}" +REDIRECT_URL="${REDIRECT_URL:-}" BLOCKLIST="${BLOCKLIST:-https://github.com/casjay/resources/raw/main/files/shallalist.tar.gz}" BLOCKED_CATEGORIES="${BLOCKED_CATEGORIES:-adv,aggressive,porn,spyware,violence,warez}" @@ -29,39 +29,11 @@ for CATEGORY in $(echo ${BLOCKED_CATEGORIES} | sed "s/,/ /g"); do echo "Category ${CATEGORY} not available!" exit 1 fi - cp -r "/tmp/blocklist/${CATEGORY}" "${DB_LOCATION}/" - - echo "dest ${CATEGORY} {" >>"${CONFIG_FILE}" - - if [ -e "${DB_LOCATION}/${CATEGORY}/domains" ]; then - echo " domainlist ${CATEGORY}/domains" >>"${CONFIG_FILE}" - fi - - if [ -e "${DB_LOCATION}/${CATEGORY}/urls" ]; then - echo " urllist ${CATEGORY}/urls" >>"${CONFIG_FILE}" - fi - - if [ -e "${DB_LOCATION}/${CATEGORY}/expressions" ]; then - echo " expressionlist ${CATEGORY}/expressions" >>"${CONFIG_FILE}" - fi - - echo "}" >>"${CONFIG_FILE}" done NOT_LIST="${BLOCKED_CATEGORIES//,/ !}" -{ - echo "acl {" - echo " default {" - echo " pass !${NOT_LIST} all" - echo " redirect $REDIRECT_URL" - echo " }" - echo "}" -} >>"${CONFIG_FILE}" - -squidGuard -b -d -C all - chown -R ${SQUID_USER}:${SQUID_USER} "${DB_LOCATION}" chown -R ${SQUID_USER}:${SQUID_USER} "${LOG_LOCATION}" chown -R ${SQUID_USER}:${SQUID_USER} "${CONFIG_FILE}"