Merge branch 'development' into new/whitelist-regex-support

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-08-22 14:19:51 +02:00
12 changed files with 151 additions and 34 deletions
+4 -5
View File
@@ -30,7 +30,6 @@ whitelistFile="${piholeDir}/whitelist.txt"
blacklistFile="${piholeDir}/blacklist.txt"
regexFile="${piholeDir}/regex.list"
adListFile="${piholeDir}/adlists.list"
auditFile="${piholeDir}/auditlog.list"
localList="${piholeDir}/local.list"
VPNList="/etc/openvpn/ipp.txt"
@@ -127,8 +126,8 @@ database_table_from_file() {
do
# Only add non-empty lines
if [[ -n "${domain}" ]]; then
if [[ "${table}" == "auditlist" ]]; then
# Auditlist table format
if [[ "${table}" == "domain_audit" ]]; then
# domain_audit table format (no enable or modified fields)
echo "${rowid},\"${domain}\",${timestamp}" >> "${tmpFile}"
else
# White-, black-, and regexlist format
@@ -194,7 +193,7 @@ migrate_to_database() {
fi
# Check if gravity database needs to be updated
upgrade_gravityDB "${gravityDBfile}" "${auditFile}"
upgrade_gravityDB "${gravityDBfile}" "${piholeDir}"
}
# Determine if DNS resolution is available before proceeding
@@ -356,7 +355,7 @@ gravity_DownloadBlocklistFromUrl() {
else
printf -v port "%s" "${PIHOLE_DNS_1#*#}"
fi
ip=$(dig "@${ip_addr}" -p "${port}" +short "${domain}")
ip=$(dig "@${ip_addr}" -p "${port}" +short "${domain}" | tail -1)
if [[ $(echo "${url}" | awk -F '://' '{print $1}') = "https" ]]; then
port=443;
else port=80