summaryrefslogtreecommitdiff
path: root/package/ppp/files/etc/ppp/ip-up.d/02-ntp
diff options
context:
space:
mode:
Diffstat (limited to 'package/ppp/files/etc/ppp/ip-up.d/02-ntp')
-rw-r--r--package/ppp/files/etc/ppp/ip-up.d/02-ntp10
1 files changed, 10 insertions, 0 deletions
diff --git a/package/ppp/files/etc/ppp/ip-up.d/02-ntp b/package/ppp/files/etc/ppp/ip-up.d/02-ntp
new file mode 100644
index 000000000..ac25dd567
--- /dev/null
+++ b/package/ppp/files/etc/ppp/ip-up.d/02-ntp
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+. /etc/rc.conf
+
+# get time via ntpclient if available
+[ -x /usr/sbin/ntpclient ] && ntpclient -s -h pool.ntp.org
+# get time via rdate if available
+[ -x /usr/sbin/rdate ] && rdate -nv pool.ntp.org
+# restart ntpd when enabled
+test x"${ntpd:-NO}" = x"NO" || /etc/init.d/ntpd restart