mirror of
https://codeberg.org/h3xx/you-dont-need-pihole.git
synced 2024-08-14 20:27:01 +00:00
Add configuration defaults
Don't depend on update.cfg being there. Move existing hard-coded config to example config.
This commit is contained in:
parent
00b114c85a
commit
b77bcfdb89
2 changed files with 16 additions and 7 deletions
|
@ -1,10 +1,11 @@
|
||||||
# vi: ft=sh
|
# vi: ft=sh
|
||||||
WORKDIR=${WORKDIR:-${BASH_SOURCE%/*}}
|
# Defaults:
|
||||||
BACKUPSUFFIX=.old
|
#WORKDIR=${WORKDIR:-${BASH_SOURCE%/*}}
|
||||||
BLOCKLIST=$WORKDIR/block.list
|
#BACKUPSUFFIX=
|
||||||
LIST_DIR=$WORKDIR/lists
|
#BLOCKLIST=$WORKDIR/block.list
|
||||||
OUT=()
|
#LIST_DIR=$WORKDIR/lists
|
||||||
URL=()
|
#OUT=()
|
||||||
|
#URL=()
|
||||||
|
|
||||||
# Individual hosts lists in that collection
|
# Individual hosts lists in that collection
|
||||||
#OUT+=("$LIST_DIR/sb-Badd-Boyz-Hosts.hosts")
|
#OUT+=("$LIST_DIR/sb-Badd-Boyz-Hosts.hosts")
|
10
update.sh
10
update.sh
|
@ -6,7 +6,15 @@ set -e
|
||||||
WORKDIR=${0%/*}
|
WORKDIR=${0%/*}
|
||||||
CFG=$WORKDIR/update.cfg
|
CFG=$WORKDIR/update.cfg
|
||||||
|
|
||||||
. "$CFG"
|
# Config defaults
|
||||||
|
BACKUPSUFFIX=
|
||||||
|
BLOCKLIST=$WORKDIR/block.list
|
||||||
|
LIST_DIR=$WORKDIR/lists
|
||||||
|
OUT=()
|
||||||
|
URL=()
|
||||||
|
if [[ -f $CFG ]]; then
|
||||||
|
. "$CFG"
|
||||||
|
fi
|
||||||
|
|
||||||
TEMP_DIR=$(mktemp -d -t "${0##*/}.XXXXXX")
|
TEMP_DIR=$(mktemp -d -t "${0##*/}.XXXXXX")
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
|
Loading…
Reference in a new issue