mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
unbound: reject invalid cache data
This commit is contained in:
parent
56af05bb7b
commit
eb72ff6d8a
@ -31,6 +31,11 @@ UNBOUNDCTL="/usr/local/sbin/unbound-control -c /var/unbound/unbound.conf"
|
||||
CACHE="/var/unbound/cache.dump.gz"
|
||||
COMMAND=${1}
|
||||
|
||||
if [ -f ${CACHE} -a "$(zcat ${CACHE} | wc -l | awk '{ print $1 }')" = "0" ]; then
|
||||
# purge invalid data
|
||||
COMMAND=flush
|
||||
fi
|
||||
|
||||
if [ "${COMMAND}" = "dump" ]; then
|
||||
${UNBOUNDCTL} dump_cache | gzip > ${CACHE}
|
||||
elif [ "${COMMAND}" = "load" -a -f "${CACHE}" ]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user