summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-19 09:17:36 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-19 09:18:17 +0200
commit5183e9cf053e098d8d6fcb9c2ab100a576f11301 (patch)
tree4b2b01e6f68b6ac096a64956a32a71464a691173
parent8fd42b024a79d12410ebf0e272991829e3488b88 (diff)
downloadvyos-1x-5183e9cf053e098d8d6fcb9c2ab100a576f11301.tar.gz
vyos-1x-5183e9cf053e098d8d6fcb9c2ab100a576f11301.zip
dhcp: op-mode: xml: error out if DHCP service not configured
(cherry picked from commit 83f9d4b8bac6b5d401dfea19d4f9d61b7e638a47)
-rw-r--r--op-mode-definitions/dhcp.xml.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/op-mode-definitions/dhcp.xml.in b/op-mode-definitions/dhcp.xml.in
index 9b21cb9af..4e7568ab6 100644
--- a/op-mode-definitions/dhcp.xml.in
+++ b/op-mode-definitions/dhcp.xml.in
@@ -130,7 +130,7 @@
<properties>
<help>Restart DHCP server process</help>
</properties>
- <command>sudo systemctl restart isc-dhcp-server.service</command>
+ <command>if cli-shell-api existsActive service dhcp-server; then sudo systemctl restart isc-dhcp-server.service; else echo "DHCP server not configured"; fi</command>
</node>
<node name="relay-agent">
<properties>