cli: add 'show ntp [sources]' command to admin-exec

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-12-14 16:40:41 +01:00
committed by Mattias Walström
parent 5adff79ad7
commit 66037ae2de
2 changed files with 28 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# Helper script to chronyc, checks if daemon is running
if ! chronyc serverstats >/dev/null; then
echo "NTP client not enabled."
exit 1
fi
case $1 in
tracking)
chronyc tracking
;;
sources)
chronyc sources -v
;;
*)
echo "Unknown NTP command."
;;
esac
+9
View File
@@ -250,6 +250,15 @@
</SWITCH>
</COMMAND>
<COMMAND name="ntp" help="Show NTP (client) status">
<ACTION sym="script">ntp tracking</ACTION>
<SWITCH name="optional" min="0">
<COMMAND name="sources" help="Show NTP sources">
<ACTION sym="script">ntp sources</ACTION>
</COMMAND>
</SWITCH>
</COMMAND>
<COMMAND name="software" help="Show software info">
<SWITCH name="optional" min="0" max="1">
<COMMAND name="name" help="Show detailed info about a partition">