Browse Source

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>
Phil Sutter 8 years ago
parent
commit
827aba9b1d

+ 1 - 1
package/busybox/Makefile

@@ -5,7 +5,7 @@ include $(ADK_TOPDIR)/rules.mk
 
 PKG_NAME:=		busybox
 PKG_VERSION:=		1.23.2
-PKG_RELEASE:=		4
+PKG_RELEASE:=		5
 PKG_HASH:=		05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a
 PKG_DESCR:=		core utilities for embedded systems
 PKG_SECTION:=		base/apps

+ 1 - 0
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'

+ 20 - 0
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 $?