diff --git a/README.md b/README.md index 28af976..ac13250 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ For progress on this necessary enhancement, see also [Issue #7](https://github.c Install a crontab like this with `crontab -e` to regularly update from my repo at 0:40 AM in the night: - 40 0 * * * sh /etc/pihole/pihole-bl-msft-telemetry-bsi/refresh_all.sh merge + 40 0 * * * /bin/bash /etc/pihole/pihole-bl-msft-telemetry-bsi/refresh_all.sh merge The big domain blocklist from file `list_of_blocklists.txt` as well as the blacklists and whitelists are diff --git a/refresh_all.sh b/refresh_all.sh index 56d0639..f9bc530 100644 --- a/refresh_all.sh +++ b/refresh_all.sh @@ -7,28 +7,34 @@ LOG_FILE="/var/log/pihole/refresh_pihole_lists.log" GIT_STATUS_CMD="git status" GIT_PULL_CMD="git pull --no-rebase" REFRESH_SCRIPT="import_lists.sh $1" +SHELL=/bin/bash -touch $LOG_FILE +if [[ ! ":$PATH:" == *":/usr/local/bin:"* ]]; then + PATH=/usr/local/bin:$PATH +fi -echo -------------------------------------------------- | tee -a $LOG_FILE | cat -echo Refreshing lists at $(date) | tee -a $LOG_FILE | cat -echo -------------------------------------------------- | tee -a $LOG_FILE | cat +touch $LOG_FILE -echo | tee -a $LOG_FILE | cat +echo "--------------------------------------------------" 2>&1 | tee -a $LOG_FILE | cat +echo "Refreshing lists at $(date) " 2>&1 | tee -a $LOG_FILE | cat +echo "--------------------------------------------------" 2>&1 | tee -a $LOG_FILE | cat +echo "" 2>&1 | tee -a $LOG_FILE | cat +echo "PATH=$PATH" 2>&1 | tee -a $LOG_FILE | cat +echo "" 2>&1 | tee -a $LOG_FILE | cat cd $MY_DIRECTORY -$GIT_STATUS_CMD | tee -a $LOG_FILE | cat +$GIT_STATUS_CMD 2>&1 | tee -a $LOG_FILE | cat -echo Pulling from remote repo... | tee -a $LOG_FILE | cat -$GIT_PULL_CMD | tee -a $LOG_FILE | cat -$GIT_STATUS_CMD | tee -a $LOG_FILE | cat +echo "Pulling from remote repo..." 2>&1 | tee -a $LOG_FILE | cat +$GIT_PULL_CMD 2>&1 | tee -a $LOG_FILE | cat +$GIT_STATUS_CMD 2>&1 | tee -a $LOG_FILE | cat -echo +echo "" 2>&1 | tee -a $LOG_FILE | cat -$SHELL $REFRESH_SCRIPT | tee -a $LOG_FILE | cat +$SHELL $REFRESH_SCRIPT 2>&1 | tee -a $LOG_FILE | cat -echo ------------------------------------------------- | tee -a $LOG_FILE | cat -echo Done refreshing lists at $(date) | tee -a $LOG_FILE | cat -echo ------------------------------------------------- | tee -a $LOG_FILE | cat +echo "-------------------------------------------------" 2>&1 | tee -a $LOG_FILE | cat +echo "Done refreshing lists at $(date) " 2>&1 | tee -a $LOG_FILE | cat +echo "-------------------------------------------------" 2>&1 | tee -a $LOG_FILE | cat -echo | tee -a $LOG_FILE | cat +echo "" 2>&1 | tee -a $LOG_FILE | cat