summaryrefslogtreecommitdiffstats
path: root/kea/bin
diff options
context:
space:
mode:
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