summaryrefslogtreecommitdiffstats
path: root/50-ntpdate
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-05-27 09:44:17 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-05-27 09:44:17 +0200
commitca29e2f3ea556c40e8d60fbf57676da71b4f39ce (patch)
tree4715f8639058efc570dd17e212cafaaaabaf86b8 /50-ntpdate
parentc41922c726bdd6b233d570dea49ced90a32eceeb (diff)
downloaddhcpcd-hook-ntpdate-7f0ad3bfbc785d7b1fc862afbbd3a7df4796671f.tar.gz
dhcpcd-hook-ntpdate-7f0ad3bfbc785d7b1fc862afbbd3a7df4796671f.tar.zst
Initial import0.1.0
Diffstat (limited to '50-ntpdate')
-rw-r--r--50-ntpdate14
1 files changed, 14 insertions, 0 deletions
diff --git a/50-ntpdate b/50-ntpdate
new file mode 100644
index 0000000..f9e980a
--- /dev/null
+++ b/50-ntpdate
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Sync time from pool.ntp.org as soon as connection is up
+
+case "${reason}" in
+ BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)
+ # this reads nameserver from /etc/ntp.conf
+ ntpd -q
+ # alternatively use ntpdate and give hostname
+ #ntpdate -u pool.ntp.org
+ ;;
+ PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP)
+ # do nothing here...
+ ;;
+esac