From 353ab3b0c3f8a6c48f242a4c9cdcebed70f9a022 Mon Sep 17 00:00:00 2001 From: Dmytro Aleksandrov Date: Wed, 15 Aug 2018 16:13:57 +0300 Subject: T689: Added ntp and date op mode definition --- op-mode-definitions/date.xml | 64 +++++++++++++++++++++++++++++++++++++++ op-mode-definitions/show-date.xml | 30 ------------------ op-mode-definitions/show-ntp.xml | 22 ++++++++++++++ 3 files changed, 86 insertions(+), 30 deletions(-) create mode 100644 op-mode-definitions/date.xml delete mode 100644 op-mode-definitions/show-date.xml create mode 100644 op-mode-definitions/show-ntp.xml (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/date.xml b/op-mode-definitions/date.xml new file mode 100644 index 000000000..15a69dbd9 --- /dev/null +++ b/op-mode-definitions/date.xml @@ -0,0 +1,64 @@ + + + + + + + Show system time and date + + /bin/date + + + + Show system date and time as Coordinated Universal Time + + /bin/date -u + + + + Show UTC date in Maya calendar format + + ${vyos_op_scripts_dir}/maya_date.py $(date +%s) + + + + + + + + + + + + Set system date and time + + <MMDDhhmm> <MMDDhhmmYY> <MMDDhhmmCCYY> <MMDDhhmmCCYY.ss> + + + /bin/date "$3" + + + + Set system date and time + + + + + Set system date and time from NTP server (default: 0.pool.ntp.org) + + /usr/sbin/ntpdate -u 0.pool.ntp.org + + + + Set system date and time from NTP server + + + + + /usr/sbin/ntpdate -u "$4" + + + + + + diff --git a/op-mode-definitions/show-date.xml b/op-mode-definitions/show-date.xml deleted file mode 100644 index 705172b39..000000000 --- a/op-mode-definitions/show-date.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - Show system time and date - - /bin/date - - - - Show system date and time as Coordinated Universal Time - - /bin/date -u - - - - Show UTC date in Maya calendar format - - ${vyos_op_scripts_dir}/maya_date.py $(date +%s) - - - - - - - - - diff --git a/op-mode-definitions/show-ntp.xml b/op-mode-definitions/show-ntp.xml new file mode 100644 index 000000000..4f2f2192b --- /dev/null +++ b/op-mode-definitions/show-ntp.xml @@ -0,0 +1,22 @@ + + + + + + + Show peer status of NTP daemon + + if ps -C ntpd &>/dev/null; then ntpdc -n -c peers; else echo NTP daemon disabled; fi + + + + Show date and time of specified NTP server + + + + + /usr/sbin/ntpdate -q "$3" + + + + -- cgit v1.2.3