summaryrefslogtreecommitdiff
path: root/package/busybox/files
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2015-07-25 14:01:32 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2015-07-25 16:22:01 +0200
commit827aba9b1defbd174e6e382ade80a70f5df3f223 (patch)
tree1793d2ee88d36e8747bb51d2ab5454d0b0632f1c /package/busybox/files
parent3b8ce24a86231eba08198d4f23f4ac761e6ac1bf (diff)
package/busybox: introduce ntpdate init script
This is useful to have a blocking instance of ntpd setting the system time at startup for daemons started later which require the time being set, like e.g. aiccu. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'package/busybox/files')
-rw-r--r--package/busybox/files/busybox.postinst1
-rw-r--r--package/busybox/files/ntpdate.init20
2 files changed, 21 insertions, 0 deletions
diff --git a/package/busybox/files/busybox.postinst b/package/busybox/files/busybox.postinst
index 75996525a..029998a98 100644
--- a/package/busybox/files/busybox.postinst
+++ b/package/busybox/files/busybox.postinst
@@ -8,4 +8,5 @@ add_rcconf syslogd NO
add_rcconf syslogd_flags '-C32'
add_rcconf inetd NO
add_rcconf ntpd NO
+add_rcconf ntpdate NO
add_rcconf ntpd_flags '-p time.fu-berlin.de'
diff --git a/package/busybox/files/ntpdate.init b/package/busybox/files/ntpdate.init
new file mode 100644
index 000000000..d812c6b47
--- /dev/null
+++ b/package/busybox/files/ntpdate.init
@@ -0,0 +1,20 @@
+#!/bin/sh
+#PKG busybox
+#INIT 55
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${ntpdate:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/ntpd -n -q $ntpd_flags
+ ;;
+*)
+ echo "Usage: $0 {start}"
+ exit 1
+ ;;
+esac
+exit $?