mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Remove local.list and openVPN traces (#5480)
This commit is contained in:
commit
aca7b31b83
@ -74,7 +74,6 @@ PIHOLE_CRON_FILE="${CRON_D_DIRECTORY}/pihole"
|
|||||||
|
|
||||||
PIHOLE_INSTALL_LOG_FILE="${PIHOLE_DIRECTORY}/install.log"
|
PIHOLE_INSTALL_LOG_FILE="${PIHOLE_DIRECTORY}/install.log"
|
||||||
PIHOLE_RAW_BLOCKLIST_FILES="${PIHOLE_DIRECTORY}/list.*"
|
PIHOLE_RAW_BLOCKLIST_FILES="${PIHOLE_DIRECTORY}/list.*"
|
||||||
PIHOLE_LOCAL_HOSTS_FILE="${PIHOLE_DIRECTORY}/local.list"
|
|
||||||
PIHOLE_LOGROTATE_FILE="${PIHOLE_DIRECTORY}/logrotate"
|
PIHOLE_LOGROTATE_FILE="${PIHOLE_DIRECTORY}/logrotate"
|
||||||
PIHOLE_FTL_CONF_FILE="${PIHOLE_DIRECTORY}/pihole.toml"
|
PIHOLE_FTL_CONF_FILE="${PIHOLE_DIRECTORY}/pihole.toml"
|
||||||
PIHOLE_VERSIONS_FILE="${PIHOLE_DIRECTORY}/versions"
|
PIHOLE_VERSIONS_FILE="${PIHOLE_DIRECTORY}/versions"
|
||||||
|
25
gravity.sh
25
gravity.sh
@ -36,9 +36,6 @@ blacklistFile="${piholeDir}/blacklist.txt"
|
|||||||
regexFile="${piholeDir}/regex.list"
|
regexFile="${piholeDir}/regex.list"
|
||||||
adListFile="${piholeDir}/adlists.list"
|
adListFile="${piholeDir}/adlists.list"
|
||||||
|
|
||||||
localList="${piholeDir}/local.list"
|
|
||||||
VPNList="/etc/openvpn/ipp.txt"
|
|
||||||
|
|
||||||
piholeGitDir="/etc/.pihole"
|
piholeGitDir="/etc/.pihole"
|
||||||
GRAVITYDB=$(getFTLConfigValue files.gravity)
|
GRAVITYDB=$(getFTLConfigValue files.gravity)
|
||||||
GRAVITY_TMPDIR=$(getFTLConfigValue files.gravity_tmp)
|
GRAVITY_TMPDIR=$(getFTLConfigValue files.gravity_tmp)
|
||||||
@ -297,12 +294,7 @@ migrate_to_database() {
|
|||||||
|
|
||||||
# Determine if DNS resolution is available before proceeding
|
# Determine if DNS resolution is available before proceeding
|
||||||
gravity_CheckDNSResolutionAvailable() {
|
gravity_CheckDNSResolutionAvailable() {
|
||||||
local lookupDomain="pi.hole"
|
local lookupDomain="raw.githubusercontent.com"
|
||||||
|
|
||||||
# Determine if $localList does not exist, and ensure it is not empty
|
|
||||||
if [[ ! -e "${localList}" ]] || [[ -s "${localList}" ]]; then
|
|
||||||
lookupDomain="raw.githubusercontent.com"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Determine if $lookupDomain is resolvable
|
# Determine if $lookupDomain is resolvable
|
||||||
if timeout 4 getent hosts "${lookupDomain}" &> /dev/null; then
|
if timeout 4 getent hosts "${lookupDomain}" &> /dev/null; then
|
||||||
@ -684,18 +676,6 @@ gravity_ShowCount() {
|
|||||||
gravity_Table_Count "vw_regex_whitelist" "regex allowed filters"
|
gravity_Table_Count "vw_regex_whitelist" "regex allowed filters"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create "localhost" entries into hosts format
|
|
||||||
gravity_generateLocalList() {
|
|
||||||
# Empty $localList if it already exists, otherwise, create it
|
|
||||||
echo "### Do not modify this file, it will be overwritten by pihole -g" > "${localList}"
|
|
||||||
chmod 644 "${localList}"
|
|
||||||
|
|
||||||
# Add additional LAN hosts provided by OpenVPN (if available)
|
|
||||||
if [[ -f "${VPNList}" ]]; then
|
|
||||||
awk -F, '{printf $2"\t"$1".vpn\n"}' "${VPNList}" >> "${localList}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Trap Ctrl-C
|
# Trap Ctrl-C
|
||||||
gravity_Trap() {
|
gravity_Trap() {
|
||||||
trap '{ echo -e "\\n\\n ${INFO} ${COL_LIGHT_RED}User-abort detected${COL_NC}"; gravity_Cleanup "error"; }' INT
|
trap '{ echo -e "\\n\\n ${INFO} ${COL_LIGHT_RED}User-abort detected${COL_NC}"; gravity_Cleanup "error"; }' INT
|
||||||
@ -883,9 +863,6 @@ if ! gravity_DownloadBlocklists; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create local.list
|
|
||||||
gravity_generateLocalList
|
|
||||||
|
|
||||||
# Update gravity timestamp
|
# Update gravity timestamp
|
||||||
update_gravity_timestamp
|
update_gravity_timestamp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user