summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-13 21:18:31 +0200
committerChristian Breunig <christian@breunig.cc>2024-07-13 21:18:31 +0200
commitca4f4343999bdbd8450ef952f42062877d6f3bab (patch)
tree0086ce61e2c37499ae4e31ac2432660878ee2b5d
parent887de85b7a78dde370ddb71ddcb3f87557536e08 (diff)
downloadvyos-1x-ca4f4343999bdbd8450ef952f42062877d6f3bab.tar.gz
vyos-1x-ca4f4343999bdbd8450ef952f42062877d6f3bab.zip
op-mode: T6575: add support for NTP service restart via CLI
This seemed to be arround in the early days, but is not available since at least VyOS 1.3.3. Add CLI helper to restart the NTP process (chrony).
-rw-r--r--op-mode-definitions/restart-ntp.xml.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/op-mode-definitions/restart-ntp.xml.in b/op-mode-definitions/restart-ntp.xml.in
new file mode 100644
index 000000000..961fae252
--- /dev/null
+++ b/op-mode-definitions/restart-ntp.xml.in
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="restart">
+ <children>
+ <node name="ntp">
+ <properties>
+ <help>Restart NTP service</help>
+ </properties>
+ <command>if cli-shell-api existsActive service ntp; then sudo systemctl restart chrony.service; else echo "Service NTP not configured"; fi</command>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>