From a54c362dff0e8c1993bb19a992544bcfa9cb44e2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 8 Nov 2022 16:06:13 +0100 Subject: Adding upstream version 20221108. Signed-off-by: Daniel Baumann --- knot-resolver/bin/kresd-cache-clear | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'knot-resolver/bin/kresd-cache-clear') 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 -- cgit v1.2.3