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:
Adam Warner 2023-06-18 12:38:02 +01:00
parent 001f2012a2
commit d637d2a7a5
No known key found for this signature in database

View file

@ -1008,27 +1008,25 @@ 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
if is_command lighty-disable-mod ; then
lighty-disable-mod pihole-admin > /dev/null || true
fi
elif [[ -d "/etc/lighttpd/conf-available" ]]; then if [[ -f "${confavailable}" ]]; then
if is_command lighty-disable-mod ; then rm "${confavailable}"
lighty-disable-mod pihole-admin > /dev/null || true fi
fi
if [[ -f "${confavailable}" ]]; then if [[ -f "${confenabled}" ]]; then
rm "${confavailable}" rm "${confenabled}"
fi fi
if [[ -f "${confenabled}" ]]; then
rm "${confenabled}"
fi
fi
} }
# Clean an existing installation to prepare for upgrade/reinstall # Clean an existing installation to prepare for upgrade/reinstall