File: cache-clear.sh

package info (click to toggle)
knot-resolver 6.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 16,392 kB
  • sloc: javascript: 42,732; ansic: 40,312; python: 12,616; cpp: 2,121; sh: 1,997; xml: 193; makefile: 181
file content (15 lines) | stat: -rwxr-xr-x 419 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash

# clear full cache
kresctl cache clear > /dev/null
if [ "$?" -ne "0" ]; then
	echo "Could not clear full cache"
	exit 1
fi

# clear just example.com. AAAA record, get JSON output
kresctl cache clear --json --exact-name --rr-type AAAA example.com. | python3 -m json.tool > /dev/null
if [ "$?" -ne "0" ]; then
	echo "Could not clear example.com. AAAA record or output is not a valid JSON"
	exit 1
fi