Skip to content

Commit

Permalink
Merge fix for #9 to master (#10)
Browse files Browse the repository at this point in the history
* Add boards.greenhouse.io to whitelist

* Bump version to v0.3

* Set change date + number of blocked domains as of Dec 22, 2022

* Reformat/beautify README.md and help info in import_lists.sh

* Reformat/beautify README.md and help info in import_lists.sh

* Reformat/beautify README.md

* Added pointers to relevant BSI documents to README.md

* Added pointers to relevant BSI documents to README.md

* Added pointers to relevant BSI documents to README.md

* Added pointers to relevant BSI documents to README.md

* Added pointers to relevant BSI documents to README.md

* Added pointers to relevant BSI documents to README.md

* Further improvement of the documentation in README.md

* Revert "Bump version to v0.3"

This reverts commit a923ca9.

* Fixed problems when refresh_all.sh is executed in cron job and /bin/sh is a symlink to /usr/bin/dash
  • Loading branch information
pschneider1968 authored Dec 23, 2022
1 parent 8d63eaa commit d19f921
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 21 additions & 15 deletions refresh_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d19f921

Please sign in to comment.