summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/40-connman-ntp.list1
-rw-r--r--packaging/connman-ntp.service13
2 files changed, 14 insertions, 0 deletions
diff --git a/packaging/40-connman-ntp.list b/packaging/40-connman-ntp.list
new file mode 100644
index 0000000..9b84282
--- /dev/null
+++ b/packaging/40-connman-ntp.list
@@ -0,0 +1 @@
+connman-ntp.service
diff --git a/packaging/connman-ntp.service b/packaging/connman-ntp.service
new file mode 100644
index 0000000..6ca46e2
--- /dev/null
+++ b/packaging/connman-ntp.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Connman NTP service
+Requires=connman.service
+After=connman.service
+
+[Service]
+Type=oneshot
+ExecStart=/bin/bash -c "dbus-send --system --type=method_call --print-reply --dest=net.connman / net.connman.Clock.SetProperty string:'TimeUpdates' variant:string:'auto'"
+ExecStop=/bin/bash -c "dbus-send --system --type=method_call --print-reply --dest=net.connman / net.connman.Clock.SetProperty string:'TimeUpdates' variant:string:'manual'"
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target