Add update-exceptions.sh

This commit is contained in:
Frank Denis
2012-09-27 22:49:23 +02:00
parent 7b6f59025e
commit 1dc4493321
2 changed files with 14 additions and 1 deletions
@@ -15,7 +15,6 @@ FAMILYSHIELD_FILE="${CONTROL_DIR}/familyshield"
INSECURE_OPENDNS_FILE="${CONTROL_DIR}/insecure-opendns"
FALLBACK_FILE="${CONTROL_DIR}/fallback"
HANDLERS_LOCK_FILE="/var/run/dnscrypt-handlers.lock"
DOMAINS_EXCEPTIONS_FILE="${CONTROL_DIR}/domains-exceptions"
DNSCRYPT_PROXY_PLUGINS_BASE_FILE="${CONTROL_DIR}/plugin"
STATIC_RESOLVERS_FILE="${CONTROL_DIR}/static-resolvers"
@@ -30,6 +29,8 @@ BLACKLIST_IPS_FILE="${CONTROL_DIR}/blacklist-ips"
BLACKLIST_IPS_TMP_FILE="${BLACKLIST_IPS_FILE}.tmp"
BLACKLIST_DOMAINS_FILE="${CONTROL_DIR}/blacklist-domains"
BLACKLIST_DOMAINS_TMP_FILE="${BLACKLIST_DOMAINS_FILE}.tmp"
DOMAINS_EXCEPTIONS_FILE="${CONTROL_DIR}/domains-exceptions"
DOMAINS_EXCEPTIONS_TMP_FILE="${DOMAINS_EXCEPTIONS_FILE}.tmp"
INTERFACE_UNBOUND="127.0.0.53"
INTERFACE_UNBOUND_MASK="24"
@@ -0,0 +1,12 @@
#! /bin/sh
. ./common.inc
if [ ! -s "$EXCEPTIONS_TMP_FILE" ]; then
rm -f "$EXCEPTIONS_FILE" "$EXCEPTIONS_TMP_FILE"
exit 0
fi
tr -s '[:blank:]' '\n' < "$EXCEPTIONS_TMP_FILE" | \
egrep -i '^\s*[0-9a-z_.-]+\s*$' > "${EXCEPTIONS_TMP_FILE}~" &&
mv "${EXCEPTIONS_TMP_FILE}~" "$EXCEPTIONS_FILE"