mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Wrap touch calls with if/then guards for Buster docker.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
899cac0aac
commit
2f38452565
1 changed files with 8 additions and 4 deletions
|
@ -1128,8 +1128,10 @@ chooseBlocklists() {
|
||||||
appendToListsFile "${choice}"
|
appendToListsFile "${choice}"
|
||||||
done
|
done
|
||||||
# Create an empty adList file with appropriate permissions.
|
# Create an empty adList file with appropriate permissions.
|
||||||
|
if [ ! -f "${adlistFile}" ]; then
|
||||||
touch "${adlistFile}"
|
touch "${adlistFile}"
|
||||||
chmod 644 "${adlistFile}"
|
chmod 644 "${adlistFile}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Accept a string parameter, it must be one of the default lists
|
# Accept a string parameter, it must be one of the default lists
|
||||||
|
@ -1330,8 +1332,10 @@ installConfigs() {
|
||||||
# and copy in the config file Pi-hole needs
|
# and copy in the config file Pi-hole needs
|
||||||
install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/${LIGHTTPD_CFG} "${lighttpdConfig}"
|
install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/${LIGHTTPD_CFG} "${lighttpdConfig}"
|
||||||
# Make sure the external.conf file exists, as lighttpd v1.4.50 crashes without it
|
# Make sure the external.conf file exists, as lighttpd v1.4.50 crashes without it
|
||||||
|
if [ ! -f /etc/lighttpd/external.conf ]; then
|
||||||
touch /etc/lighttpd/external.conf
|
touch /etc/lighttpd/external.conf
|
||||||
chmod 644 /etc/lighttpd/external.conf
|
chmod 644 /etc/lighttpd/external.conf
|
||||||
|
fi
|
||||||
# If there is a custom block page in the html/pihole directory, replace 404 handler in lighttpd config
|
# If there is a custom block page in the html/pihole directory, replace 404 handler in lighttpd config
|
||||||
if [[ -f "${PI_HOLE_BLOCKPAGE_DIR}/custom.php" ]]; then
|
if [[ -f "${PI_HOLE_BLOCKPAGE_DIR}/custom.php" ]]; then
|
||||||
sed -i 's/^\(server\.error-handler-404\s*=\s*\).*$/\1"\/pihole\/custom\.php"/' "${lighttpdConfig}"
|
sed -i 's/^\(server\.error-handler-404\s*=\s*\).*$/\1"\/pihole\/custom\.php"/' "${lighttpdConfig}"
|
||||||
|
|
Loading…
Reference in a new issue