summaryrefslogtreecommitdiffstats
path: root/knot/bin/knot-zones-reset
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/bin/knot-zones-reset
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 '')
-rwxr-xr-xknot/bin/knot-zones-reset94
1 files changed, 32 insertions, 62 deletions
diff --git a/knot/bin/knot-zones-reset b/knot/bin/knot-zones-reset
index 63d38fd..8ab2dca 100755
--- a/knot/bin/knot-zones-reset
+++ b/knot/bin/knot-zones-reset
@@ -21,65 +21,35 @@
set -e
-HOSTS="${*:-localhost}"
-
-for HOST in ${HOSTS}
-do
- case "${HOST}" in
- localhost)
- echo "Resetting in-memory data for all zones..."
-
- if systemctl status knot | grep -qs 'Active: active'
- then
- START="true"
- sudo service knot stop
- else
- START="false"
- fi
-
- sudo rm -rf /var/lib/knot/journal/*.mdb
- sudo rm -rf /var/lib/knot/timers/*.mdb
-
- if [ -e /var/lib/knot/zones/.git ]
- then
- sudo chown -R root:root /var/lib/knot/zones/
-
- cd /var/lib/knot/zones
- sudo git clean -dxf
- sudo git checkout -f
-
- sudo chown -R knot:knot /var/lib/knot/zones/
- fi
-
- case "${START}" in
- true)
- sudo service knot start
- ;;
- esac
-
- echo
- echo "done."
- ;;
-
- *)
- echo "'${HOST}': Resetting in-memory data for all zones..."
-
- ssh "${HOST}" \
- "sudo service knot stop && \
- sudo rm -rf /var/lib/knot/journal/*.mdb && \
- sudo rm -rf /var/lib/knot/timers/*.mdb && \
- if [ -e /var/lib/knot/zones/.git ]; \
- then \
- sudo chown -R root:root /var/lib/knot/zones/; \
- cd /var/lib/knot/zones; \
- sudo git clean -dxf; \
- sudo git checkout -f; \
- sudo chown -R knot:knot /var/lib/knot/zones/; \
- fi; \
- sudo service knot start"
-
- echo
- echo "done."
- ;;
- esac
-done
+echo "Resetting in-memory data for all zones..."
+
+if systemctl status knot | grep -qs 'Active: active'
+then
+ START="true"
+ sudo service knot stop
+else
+ START="false"
+fi
+
+sudo rm -rf /var/lib/knot/journal/*.mdb
+sudo rm -rf /var/lib/knot/timers/*.mdb
+
+if [ -e /var/lib/knot/zones/.git ]
+then
+ sudo chown -R root:root /var/lib/knot/zones/
+
+ cd /var/lib/knot/zones
+ sudo git clean -dxf
+ sudo git checkout -f
+
+ sudo chown -R knot:knot /var/lib/knot/zones/
+fi
+
+case "${START}" in
+ true)
+ sudo service knot start
+ ;;
+esac
+
+echo
+echo "done."