summaryrefslogtreecommitdiff
path: root/op-mode-definitions/date.xml.in
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-09-15 11:49:37 +0200
committerChristian Breunig <christian@breunig.cc>2024-09-15 11:49:37 +0200
commit835126e249c1a8b7ae87ac169a8eb9d2df979249 (patch)
tree7b0d9a90fdd57680f22723a1ef4ea34032451c69 /op-mode-definitions/date.xml.in
parent5df36ba0e3c95efb2962ed54e614552f7425e173 (diff)
downloadvyos-1x-835126e249c1a8b7ae87ac169a8eb9d2df979249.tar.gz
vyos-1x-835126e249c1a8b7ae87ac169a8eb9d2df979249.zip
op-mode: T6715: manually changing time/date is not synced into hardware clock
When not using NTP and adjusting the current system time/date using set date the time is not saved across a reboot into the hardware RTC. This commit explicitly syncs the current time after a change into the systems RTC. Most routers do not run without NTP (which is even a VyOS default) so the priority is pretty low.
Diffstat (limited to 'op-mode-definitions/date.xml.in')
-rw-r--r--op-mode-definitions/date.xml.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/op-mode-definitions/date.xml.in b/op-mode-definitions/date.xml.in
index 6d8586025..4e62a8335 100644
--- a/op-mode-definitions/date.xml.in
+++ b/op-mode-definitions/date.xml.in
@@ -35,7 +35,7 @@
<list>&lt;MMDDhhmm&gt; &lt;MMDDhhmmYY&gt; &lt;MMDDhhmmCCYY&gt; &lt;MMDDhhmmCCYY.ss&gt;</list>
</completionHelp>
</properties>
- <command>/bin/date "$3"</command>
+ <command>sudo bash -c "/bin/date '$3' &amp;&amp; hwclock --systohc --localtime"</command>
</tagNode>
</children>
</node>