summaryrefslogtreecommitdiffstats
path: root/kea/bin/kea-leases-reset
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-10-30 12:57:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-10-30 12:57:16 +0000
commit56fa85dba2506fa0ceb38190bc3e428ddcc117dc (patch)
treeaa87a3873cfc3e5e9d5736d69dd98714628d90f7 /kea/bin/kea-leases-reset
parentReleasing debian version 20220704-1. (diff)
downloadopen-infrastructure-service-tools-56fa85dba2506fa0ceb38190bc3e428ddcc117dc.tar.xz
open-infrastructure-service-tools-56fa85dba2506fa0ceb38190bc3e428ddcc117dc.zip
Merging upstream version 20221030.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xkea/bin/kea-leases-reset (renamed from knot/bin/knot-reset-zones)40
1 files changed, 20 insertions, 20 deletions
diff --git a/knot/bin/knot-reset-zones b/kea/bin/kea-leases-reset
index 40779cf..92265f4 100755
--- a/knot/bin/knot-reset-zones
+++ b/kea/bin/kea-leases-reset
@@ -21,38 +21,38 @@
set -e
-HOSTS="${*}"
-
-if [ -z "${HOSTS}" ]
-then
- echo "Usage: ${0} localhost|[HOST1 HOST2 ...]" >&2
- exit 1
-fi
+HOSTS="${*:-localhost}"
for HOST in ${HOSTS}
do
case "${HOST}" in
localhost)
- echo -n "Resetting in-memory data for all zones..."
+ echo "Removing all leases..."
+
+ sudo service kea-dhcp6-server stop
+ sudo service kea-dhcp4-server stop
- service knot stop
- rm -rf /var/lib/knot/journal/*.mdb
- rm -rf /var/lib/knot/timers/*.mdb
- service knot start
+ sudo rm -f /var/lib/kea/*.csv*
- echo " done."
+ sudo service kea-dhcp6-server start
+ sudo service kea-dhcp4-server start
+
+ echo
+ echo "done."
;;
*)
- echo -n "'${HOST}': Resetting in-memory data for all zones..."
+ echo "'${HOST}': Removing all leases..."
ssh "${HOST}" \
- "sudo service knot stop && \
- rm -rf /var/lib/knot/journal/*.mdb && \
- rm -rf /var/lib/knot/timers/*.mdb && \
- sudo service knot start"
-
- echo " done."
+ "sudo service kea-dhcp6-server stop; \
+ sudo service kea-dhcp4-server stop; \
+ sudo rm -f /var/lib/kea/*.csv*; \
+ sudo service kea-dhcp6-server start; \
+ sudo service kea-dhcp4-server start"
+
+ echo
+ echo "done."
;;
esac
done