mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Create custom.list during install/update if it doesn't exist
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
b0ea043b6a
commit
18c24d985f
1 changed files with 14 additions and 0 deletions
|
@ -70,6 +70,7 @@ PI_HOLE_BLOCKPAGE_DIR="${webroot}/pihole"
|
||||||
useUpdateVars=false
|
useUpdateVars=false
|
||||||
|
|
||||||
adlistFile="/etc/pihole/adlists.list"
|
adlistFile="/etc/pihole/adlists.list"
|
||||||
|
="${PI_HOLE_CONFIG_DIR}/custom.list"
|
||||||
# Pi-hole needs an IP address; to begin, these variables are empty since we don't know what the IP is until
|
# Pi-hole needs an IP address; to begin, these variables are empty since we don't know what the IP is until
|
||||||
# this script can run
|
# this script can run
|
||||||
IPV4_ADDRESS=${IPV4_ADDRESS}
|
IPV4_ADDRESS=${IPV4_ADDRESS}
|
||||||
|
@ -1810,6 +1811,16 @@ installPiholeWeb() {
|
||||||
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Creates custom DNS file if it does not exist
|
||||||
|
installCustomDNSfile() {
|
||||||
|
|
||||||
|
if [[ ! -e "${customDNSfile}" ]]; then
|
||||||
|
touch "${customDNSfile}"
|
||||||
|
chmod 644 "${customDNSfile}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# Installs a cron file
|
# Installs a cron file
|
||||||
installCron() {
|
installCron() {
|
||||||
# Install the cron job
|
# Install the cron job
|
||||||
|
@ -2037,6 +2048,9 @@ installPihole() {
|
||||||
# install a man page entry for pihole
|
# install a man page entry for pihole
|
||||||
install_manpage
|
install_manpage
|
||||||
|
|
||||||
|
# install custom DNS file if it does not exist
|
||||||
|
installCustomDNSfile
|
||||||
|
|
||||||
# Update setupvars.conf with any variables that may or may not have been changed during the install
|
# Update setupvars.conf with any variables that may or may not have been changed during the install
|
||||||
finalExports
|
finalExports
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue