minor changes

- logs the number of items in individual blocklists (easier to troubleshoot)
- seting logfile in set_env
- unzip overwrites files while updating.
This commit is contained in:
robocopAlpha 2021-07-16 04:40:34 +03:00
parent 83c90411b7
commit 808b31d0d1
4 changed files with 9 additions and 9 deletions

View file

@ -5,13 +5,13 @@ fetch_hosts(){
URL=$1
FNAME=$2
curl -sSL "${URL}" | rg -INv "^[#]|localhost" | sd '\s+$' '' | sd "^0\\.0\\.0\\.0 |^127\\.0\\.0\\.1 " "" | sd "\\#.*" "" >| ${FNAME}
curl -sSL "${URL}" | rg -INv "^[#<]|localhost" | sd '\s+$' '' | sd "^0\\.0\\.0\\.0 |^127\\.0\\.0\\.1 " "" | sd "\\#.*" "" >| ${FNAME}
}
fetch_blocklist(){
URL=$1
FNAME=$2
curl -sSL "${URL}" | rg -INv "^[#]|localhost" | sd '\s+$' '' | sd "\\#.*" "" >| ${FNAME}
curl -sSL "${URL}" | rg -INv "^[#<]|localhost" | sd '\s+$' '' | sd "\\#.*" "" >| ${FNAME}
}
@ -48,3 +48,8 @@ else
fi
WRK_DIR=${HOME_DIR}/pihole_lists
LOGFILE="${WRK_DIR}/pull.log"
if [ ! -f "$LOGFILE" ] ; then
touch "$LOGFILE"
fi