From a211d7fcbed2b8c791db0134c18c61578d82b639 Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sat, 21 Nov 2015 11:27:07 +0000 Subject: vyatta-op: add restart cli command for ntp Add a CLI op mode command to allow restarting of the NTP service without having to update the configuration. Bug #514 http://bugzilla.vyos.net/show_bug.cgi?id=514 --- templates/restart/ntp/node.def | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 templates/restart/ntp/node.def diff --git a/templates/restart/ntp/node.def b/templates/restart/ntp/node.def new file mode 100644 index 0000000..d94bb8e --- /dev/null +++ b/templates/restart/ntp/node.def @@ -0,0 +1,12 @@ +help: Restart NTP service + +run: + if cli-shell-api existsActive system ntp server; then + echo "Restarting NTP server..." + sudo /usr/sbin/invoke-rc.d ntp force-reload + if [[ $? -eq 0 ]]; then + echo "Success!" + fi + else + echo "NTP server is not configured" + fi -- cgit v1.2.3