cli: handle case when dhcp server is not active

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-01-31 13:56:40 +01:00
parent cb73ddf6bf
commit a5aba02ddd
2 changed files with 42 additions and 12 deletions
+3 -12
View File
@@ -303,24 +303,15 @@
</COMMAND>
<COMMAND name="dhcp-server" help="Show DHCP server status">
<ACTION sym="script">
sysrepocfg -f json -X -d operational -m infix-dhcp-server | \
/usr/libexec/statd/cli-pretty "show-dhcp-server"
</ACTION>
<ACTION sym="script" in="tty" out="tty" interrupt="true">show dhcp</ACTION>
<SWITCH name="optional" min="0">
<COMMAND name="statistics" help="Show DHCP server statistics">
<ACTION sym="script">
sysrepocfg -f json -X -d operational -m infix-dhcp-server | \
/usr/libexec/statd/cli-pretty "show-dhcp-server" -s
</ACTION>
<ACTION sym="script" in="tty" out="tty" interrupt="true">show dhcp stat</ACTION>
</COMMAND>
<COMMAND name="detailed" help="Detailed (full operational) output">
<ACTION sym="script">
sysrepocfg -f json -X -d operational -m infix-dhcp-server | \
jq -C .
</ACTION>
<ACTION sym="script" in="tty" out="tty" interrupt="true">show dhcp detail</ACTION>
</COMMAND>
</SWITCH>