summaryrefslogtreecommitdiffstats
path: root/knot-resolver
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-08 15:06:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-08 15:06:16 +0000
commit4ee45feec614f4caace1dd1aed61b44b68ad3fbb (patch)
treeb5ef57fac0f835230a5ea6bcbb1b256e2b077816 /knot-resolver
parentReleasing debian version 20221101-1. (diff)
downloadopen-infrastructure-service-tools-4ee45feec614f4caace1dd1aed61b44b68ad3fbb.tar.xz
open-infrastructure-service-tools-4ee45feec614f4caace1dd1aed61b44b68ad3fbb.zip
Merging upstream version 20221108.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'knot-resolver')
-rwxr-xr-xknot-resolver/bin/kresd-cache-clear29
1 files changed, 4 insertions, 25 deletions
diff --git a/knot-resolver/bin/kresd-cache-clear b/knot-resolver/bin/kresd-cache-clear
index 49c2462..5b9a0e1 100755
--- a/knot-resolver/bin/kresd-cache-clear
+++ b/knot-resolver/bin/kresd-cache-clear
@@ -21,31 +21,10 @@
set -e
-HOSTS="${*:-localhost}"
+NUMBER="$(systemctl | grep -c 'kresd@[0-9].service')"
-for HOST in ${HOSTS}
+for NUMBER in $(seq 1 "${NUMBER}")
do
- case "${HOST}" in
- localhost)
- NUMBER="$(systemctl | grep -c 'kresd@[0-9].service')"
-
- for NUMBER in $(seq 1 "${NUMBER}")
- do
- echo "Flushing localhost, resolver ${NUMBER}"
- echo "cache.clear()" | sudo socat - UNIX-CONNECT:/run/knot-resolver/control/"${NUMBER}"
- done
- ;;
-
- *)
- NUMBER="$(ssh "${HOST}" sudo systemctl | grep -c 'kresd@[0-9].service')"
-
- for NUMBER in $(seq 1 "${NUMBER}")
- do
- echo "Flushing ${HOST}, resolver ${NUMBER}"
- echo "cache.clear()" | ssh "${HOST}" sudo socat - UNIX-CONNECT:/run/knot-resolver/control/"${NUMBER}"
- done
- ;;
- esac
+ echo "Flushing localhost, resolver ${NUMBER}"
+ echo "cache.clear()" | sudo socat - UNIX-CONNECT:/run/knot-resolver/control/"${NUMBER}"
done
-
-echo