Assure that Lighttpd conf-enabled symlink is removed
`/etc/lighttpd/conf-enabled` usually contains symlinks to the actual files in `/etc/lighttpd/conf-available`, at least `lighty-enable-mod` does exactly this. If `/etc/lighttpd/conf-available/15-pihole-admin.conf` is removed first, `/etc/lighttpd/conf-enabled/15-pihole-admin.conf` hence points to nowhere, which makes the `-f` check return false. The orphaned symlink is hence not removed, if `lighty-disable-mod` is not available. This PR changes the order, to remove the symlink first, and to be failsafe also if it is orphaned already, and the actual config afterwards. Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
parent
667a25574a
commit
8e706e4a16
|
@ -1208,12 +1208,12 @@ remove_old_pihole_lighttpd_configs() {
|
||||||
lighty-disable-mod pihole-admin >/dev/null || true
|
lighty-disable-mod pihole-admin >/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "${confavailable}" ]]; then
|
if [[ -f "${confenabled}" || -L "${confenabled}" ]]; then
|
||||||
rm "${confavailable}"
|
rm "${confenabled}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "${confenabled}" ]]; then
|
if [[ -f "${confavailable}" ]]; then
|
||||||
rm "${confenabled}"
|
rm "${confavailable}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue