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:17:50 +0200
commit83f9d4b8bac6b5d401dfea19d4f9d61b7e638a47 (patch)
treeffe94ecad5b88b515140163814661afa7e97fcc3
parent41807725cad3266bf426a9de411bb693b914395e (diff)
downloadvyos-1x-83f9d4b8bac6b5d401dfea19d4f9d61b7e638a47.tar.gz
vyos-1x-83f9d4b8bac6b5d401dfea19d4f9d61b7e638a47.zip
dhcp: op-mode: xml: error out if DHCP service not configured
-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>