summaryrefslogtreecommitdiffstats
path: root/knot-resolver/bin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-11-08 14:39:19 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-11-08 14:39:19 +0000
commite4fc8d2795b05039ab689b527a8546fb71d31362 (patch)
tree860bbd820746a44005b09ed7afdc2f1d37d41c87 /knot-resolver/bin
parentCorrecting cosmetic typo in dehydrated extra-cert hook output. (diff)
downloadservice-tools-e4fc8d2795b05039ab689b527a8546fb71d31362.tar.xz
service-tools-e4fc8d2795b05039ab689b527a8546fb71d31362.zip
Removing ssh remote part from knot related commands.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'knot-resolver/bin')
-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