mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Add code to remove old lighttpd config files left over from v5. (#5314)
This commit is contained in:
commit
0fa5c62450
2 changed files with 30 additions and 1 deletions
|
@ -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…
Reference in a new issue