From 89e4dfebe53d439aed0f2bc105307f2ebac03327 Mon Sep 17 00:00:00 2001 From: Dan Church Date: Sat, 12 Nov 2022 10:27:52 -0600 Subject: [PATCH 1/5] Fix markdown formatting --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 9f21f3d..8f9f2e1 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,13 @@ static domain_name_servers=127.0.0.1 ## License Copyright (C) 2021-2022 Dan Church. + License GPLv3: GNU GPL version 3.0 (https://www.gnu.org/licenses/gpl-3.0.html) + with Commons Clause 1.0 (https://commonsclause.com/). + This is free software: you are free to change and redistribute it. + There is NO WARRANTY, to the extent permitted by law. + You may NOT use this software for commercial purposes. From a46ad0e94327a0cd3f3863d18c2102c69b0a4390 Mon Sep 17 00:00:00 2001 From: Dan Church Date: Sat, 12 Nov 2022 10:59:45 -0600 Subject: [PATCH 2/5] Update gitignore --- .gitignore | 5 +++-- lists/.gitignore | 7 +++++++ lists/.gitkeep | 0 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 lists/.gitignore delete mode 100644 lists/.gitkeep diff --git a/.gitignore b/.gitignore index 75d5e8b..003a0ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -block.list -*.list.old +/*.list.old +/block.list +/update.cfg diff --git a/lists/.gitignore b/lists/.gitignore new file mode 100644 index 0000000..f59469d --- /dev/null +++ b/lists/.gitignore @@ -0,0 +1,7 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore +# ... And some others +!/AdroitAdorKhan-core.hosts +!/custom-ad-domains.domains diff --git a/lists/.gitkeep b/lists/.gitkeep deleted file mode 100644 index e69de29..0000000 From 881debf6bb1d81bdb2eb6dab87b22b7cb2fa3dbb Mon Sep 17 00:00:00 2001 From: Dan Church Date: Sat, 12 Nov 2022 11:06:13 -0600 Subject: [PATCH 3/5] Add documentation for URL, OUT arrays --- update.cfg.example | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/update.cfg.example b/update.cfg.example index f5a4f52..91534d2 100644 --- a/update.cfg.example +++ b/update.cfg.example @@ -17,6 +17,16 @@ #BACKUPSUFFIX= #BLOCKLIST=$WORKDIR/block.list #LIST_DIR=$WORKDIR/lists + +# Simple URL grab list +# Mirror any URL to the 'lists' directory. +# Note: URL and OUT indices are correlated, e.g. URL[10] will be retrieved and +# stored in OUT[10] +# Example config: +# URL+=('https://example.com/mylist.hosts') +# OUT+=("$LIST_DIR/mylist.hosts") +# URL+=('https://example.com/others.hosts') +# OUT+=("$LIST_DIR/others.hosts") #OUT=() #URL=() From 6f86038404ca370cec36dcf90ec9610f7ce2072a Mon Sep 17 00:00:00 2001 From: Dan Church Date: Sat, 12 Nov 2022 11:20:33 -0600 Subject: [PATCH 4/5] Clean up update.cfg --- update.cfg.example | 8 -------- 1 file changed, 8 deletions(-) diff --git a/update.cfg.example b/update.cfg.example index 91534d2..b2da474 100644 --- a/update.cfg.example +++ b/update.cfg.example @@ -29,11 +29,3 @@ # OUT+=("$LIST_DIR/others.hosts") #OUT=() #URL=() - -# Individual hosts lists in that collection -#OUT+=("$LIST_DIR/sb-Badd-Boyz-Hosts.hosts") -#URL+=('https://raw.githubusercontent.com/StevenBlack/hosts/master/data/Badd-Boyz-Hosts/hosts') - -# Not sure how I'm supposed to update this file... -#OUT+=("$LIST_DIR/list.1.raw.githubusercontent.com.domains") -#URL+=('???') From 65ade612e7e7ba4a45c7a5cca2eff65a41757830 Mon Sep 17 00:00:00 2001 From: Dan Church Date: Sat, 12 Nov 2022 11:22:13 -0600 Subject: [PATCH 5/5] Replace Slackware-specific dnsmasq restart --- update.cfg.example | 11 +++++++++++ update.sh | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/update.cfg.example b/update.cfg.example index b2da474..fcda8c6 100644 --- a/update.cfg.example +++ b/update.cfg.example @@ -29,3 +29,14 @@ # OUT+=("$LIST_DIR/others.hosts") #OUT=() #URL=() + +# What to run in order to restart dnsmasq. Leave empty to restart manually. +# Note: if you need shell features, use (bash -c '...') +# Typical value: +# Ubuntu/Debian/CentOS: +# DNSMASQ_RESTART_COMMAND=(service dnsmasq restart) +# Slackware: +# DNSMASQ_RESTART_COMMAND=(/etc/rc.d/rc.dnsmasq restart) +# Mac OSX (with homebrew): +# DNSMASQ_RESTART_COMMAND=(brew services restart dnsmasq) +#DNSMASQ_RESTART_COMMAND=() diff --git a/update.sh b/update.sh index 9ec6543..81b68f5 100755 --- a/update.sh +++ b/update.sh @@ -25,6 +25,7 @@ BLOCKLIST=$WORKDIR/block.list LIST_DIR=$WORKDIR/lists OUT=() URL=() +DNSMASQ_RESTART_COMMAND=() if [[ -f $CFG ]]; then . "$CFG" fi @@ -90,6 +91,6 @@ if [[ -n $BACKUPSUFFIX && -f $BLOCKLIST$BACKUPSUFFIX ]]; then fi fi -if [[ -x /etc/rc.d/rc.dnsmasq ]]; then - /etc/rc.d/rc.dnsmasq restart +if [[ ${#DNSMASQ_RESTART_COMMAND[@]} -gt 0 ]]; then + "${DNSMASQ_RESTART_COMMAND[@]}" fi