mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-22 22:23:41 +00:00
Simplify nested if statements.
Co-authored-by: yubiuser <ckoenig@posteo.de> Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
001f2012a2
commit
d637d2a7a5
1 changed files with 14 additions and 16 deletions
|
@ -1008,15 +1008,14 @@ remove_old_pihole_lighttpd_configs() {
|
||||||
local confenabled="/etc/lighttpd/conf-enabled/15-pihole-admin.conf"
|
local confenabled="/etc/lighttpd/conf-enabled/15-pihole-admin.conf"
|
||||||
|
|
||||||
|
|
||||||
if [[ -d "/etc/lighttpd/conf.d" ]]; then
|
if [[ -f "${lighttpdConfig}" ]]; then
|
||||||
sed -i '/include "\/etc\/lighttpd\/conf.d\/pihole-admin.conf"/d' "${lighttpdConfig}"
|
sed -i '/include "\/etc\/lighttpd\/conf.d\/pihole-admin.conf"/d' "${lighttpdConfig}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -f "${condfd}" ]]; then
|
if [[ -f "${condfd}" ]]; then
|
||||||
rm "${condfd}"
|
rm "${condfd}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
elif [[ -d "/etc/lighttpd/conf-available" ]]; then
|
|
||||||
if is_command lighty-disable-mod ; then
|
if is_command lighty-disable-mod ; then
|
||||||
lighty-disable-mod pihole-admin > /dev/null || true
|
lighty-disable-mod pihole-admin > /dev/null || true
|
||||||
fi
|
fi
|
||||||
|
@ -1028,7 +1027,6 @@ remove_old_pihole_lighttpd_configs() {
|
||||||
if [[ -f "${confenabled}" ]]; then
|
if [[ -f "${confenabled}" ]]; then
|
||||||
rm "${confenabled}"
|
rm "${confenabled}"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clean an existing installation to prepare for upgrade/reinstall
|
# Clean an existing installation to prepare for upgrade/reinstall
|
||||||
|
|
Loading…
Reference in a new issue