summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-06-15 12:32:07 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-06-28 09:09:06 +0000
commit7ed0fa3092744a8fe9d0b9ebd2d126e5e07b6285 (patch)
tree9287487de0eb6986ef3bbd841d78acb828128517 /op-mode-definitions
parenta3559f7e429c86ccdfeeac0aaddfc054be403368 (diff)
downloadvyos-1x-7ed0fa3092744a8fe9d0b9ebd2d126e5e07b6285.tar.gz
vyos-1x-7ed0fa3092744a8fe9d0b9ebd2d126e5e07b6285.zip
op-mode: T1375: Allow to clear dhcp-server lease
Allow to reset dhcp-leases per ip Parse file '/config/dhcpd.leases' find match section 'lease x.x.x.x {}' And remove this section clear dhcp-server lease 192.0.2.21 (cherry picked from commit a83eecfeee1f925c914a46623dd35f96b48389f8)
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/clear-dhcp-server-lease.xml.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/op-mode-definitions/clear-dhcp-server-lease.xml.in b/op-mode-definitions/clear-dhcp-server-lease.xml.in
new file mode 100644
index 000000000..b1241588c
--- /dev/null
+++ b/op-mode-definitions/clear-dhcp-server-lease.xml.in
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="clear">
+ <children>
+ <node name="dhcp-server">
+ <properties>
+ <help>clear DHCP server lease</help>
+ </properties>
+ <children>
+ <tagNode name="lease">
+ <properties>
+ <help>DHCP server lease</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/clear_dhcp_lease.py --ip $4</command>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>