Add code to remove old lighttpd config files left over from v5. (#5314)

pull/5319/head
Adam Warner 11 months ago committed by GitHub
commit 0fa5c62450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1001,6 +1001,34 @@ remove_old_dnsmasq_ftl_configs() {
fi
}
remove_old_pihole_lighttpd_configs() {
local lighttpdConfig="/etc/lighttpd/lighttpd.conf"
local condfd="/etc/lighttpd/conf.d/pihole-admin.conf"
local confavailable="/etc/lighttpd/conf-available/15-pihole-admin.conf"
local confenabled="/etc/lighttpd/conf-enabled/15-pihole-admin.conf"
if [[ -f "${lighttpdConfig}" ]]; then
sed -i '/include "\/etc\/lighttpd\/conf.d\/pihole-admin.conf"/d' "${lighttpdConfig}"
fi
if [[ -f "${condfd}" ]]; then
rm "${condfd}"
fi
if is_command lighty-disable-mod ; then
lighty-disable-mod pihole-admin > /dev/null || true
fi
if [[ -f "${confavailable}" ]]; then
rm "${confavailable}"
fi
if [[ -f "${confenabled}" ]]; then
rm "${confenabled}"
fi
}
# Clean an existing installation to prepare for upgrade/reinstall
clean_existing() {
# Local, named variables
@ -1486,6 +1514,7 @@ installPihole() {
fi
remove_old_dnsmasq_ftl_configs
remove_old_pihole_lighttpd_configs
# Install config files
if ! installConfigs; then

@ -178,7 +178,7 @@ database_table_from_file() {
echo "${rowid},\"${domain}\",${timestamp}" >> "${tmpFile}"
elif [[ "${table}" == "adlist" ]]; then
# Adlist table format
echo "${rowid},\"${domain}\",1,${timestamp},${timestamp},\"Migrated from ${src}\",,0,0,0" >> "${tmpFile}"
echo "${rowid},\"${domain}\",1,${timestamp},${timestamp},\"Migrated from ${src}\",,0,0,0,0" >> "${tmpFile}"
else
# White-, black-, and regexlist table format
echo "${rowid},${list_type},\"${domain}\",1,${timestamp},${timestamp},\"Migrated from ${src}\"" >> "${tmpFile}"

Loading…
Cancel
Save