Compare commits

...

5 Commits

Author SHA1 Message Date
Dan Church 65ade612e7
Replace Slackware-specific dnsmasq restart 2022-11-12 12:01:03 -06:00
Dan Church 6f86038404
Clean up update.cfg 2022-11-12 11:27:01 -06:00
Dan Church 881debf6bb
Add documentation for URL, OUT arrays 2022-11-12 11:27:01 -06:00
Dan Church a46ad0e943
Update gitignore 2022-11-12 11:27:01 -06:00
Dan Church 89e4dfebe5
Fix markdown formatting 2022-11-12 10:27:52 -06:00
6 changed files with 38 additions and 11 deletions

5
.gitignore vendored
View File

@ -1,2 +1,3 @@
block.list /*.list.old
*.list.old /block.list
/update.cfg

View File

@ -59,8 +59,13 @@ static domain_name_servers=127.0.0.1
## License ## License
Copyright (C) 2021-2022 Dan Church. Copyright (C) 2021-2022 Dan Church.
License GPLv3: GNU GPL version 3.0 (https://www.gnu.org/licenses/gpl-3.0.html) License GPLv3: GNU GPL version 3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
with Commons Clause 1.0 (https://commonsclause.com/). with Commons Clause 1.0 (https://commonsclause.com/).
This is free software: you are free to change and redistribute it. This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. There is NO WARRANTY, to the extent permitted by law.
You may NOT use this software for commercial purposes. You may NOT use this software for commercial purposes.

7
lists/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
# ... And some others
!/AdroitAdorKhan-core.hosts
!/custom-ad-domains.domains

View File

View File

@ -17,13 +17,26 @@
#BACKUPSUFFIX= #BACKUPSUFFIX=
#BLOCKLIST=$WORKDIR/block.list #BLOCKLIST=$WORKDIR/block.list
#LIST_DIR=$WORKDIR/lists #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=() #OUT=()
#URL=() #URL=()
# Individual hosts lists in that collection # What to run in order to restart dnsmasq. Leave empty to restart manually.
#OUT+=("$LIST_DIR/sb-Badd-Boyz-Hosts.hosts") # Note: if you need shell features, use (bash -c '...')
#URL+=('https://raw.githubusercontent.com/StevenBlack/hosts/master/data/Badd-Boyz-Hosts/hosts') # Typical value:
# Ubuntu/Debian/CentOS:
# Not sure how I'm supposed to update this file... # DNSMASQ_RESTART_COMMAND=(service dnsmasq restart)
#OUT+=("$LIST_DIR/list.1.raw.githubusercontent.com.domains") # Slackware:
#URL+=('???') # DNSMASQ_RESTART_COMMAND=(/etc/rc.d/rc.dnsmasq restart)
# Mac OSX (with homebrew):
# DNSMASQ_RESTART_COMMAND=(brew services restart dnsmasq)
#DNSMASQ_RESTART_COMMAND=()

View File

@ -25,6 +25,7 @@ BLOCKLIST=$WORKDIR/block.list
LIST_DIR=$WORKDIR/lists LIST_DIR=$WORKDIR/lists
OUT=() OUT=()
URL=() URL=()
DNSMASQ_RESTART_COMMAND=()
if [[ -f $CFG ]]; then if [[ -f $CFG ]]; then
. "$CFG" . "$CFG"
fi fi
@ -90,6 +91,6 @@ if [[ -n $BACKUPSUFFIX && -f $BLOCKLIST$BACKUPSUFFIX ]]; then
fi fi
fi fi
if [[ -x /etc/rc.d/rc.dnsmasq ]]; then if [[ ${#DNSMASQ_RESTART_COMMAND[@]} -gt 0 ]]; then
/etc/rc.d/rc.dnsmasq restart "${DNSMASQ_RESTART_COMMAND[@]}"
fi fi