Add an hotplug script, so that if network is not up, time will be synchronised (#900)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@5420 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
0ea49f4a25
commit
cac0900736
@ -94,6 +94,8 @@ define Package/openntpd/install
|
|||||||
install -m0644 ./files/ntpd.conf $(1)/etc/
|
install -m0644 ./files/ntpd.conf $(1)/etc/
|
||||||
install -d -m0755 $(1)/etc/init.d
|
install -d -m0755 $(1)/etc/init.d
|
||||||
install -m0755 ./files/ntpd.init $(1)/etc/init.d/ntpd
|
install -m0755 ./files/ntpd.init $(1)/etc/init.d/ntpd
|
||||||
|
install -d -m0755 $(1)/etc/hotplug.d/iface
|
||||||
|
install -m0755 ./files/ntpd.hotplug $(1)/etc/hotplug.d/iface/20-ntpd
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,openntpd))
|
$(eval $(call BuildPackage,openntpd))
|
||||||
|
10
net/openntpd/files/ntpd.hotplug
Normal file
10
net/openntpd/files/ntpd.hotplug
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
NAME=ntpd
|
||||||
|
CONFIG=/etc/$NAME.conf
|
||||||
|
COMMAND=/usr/sbin/$NAME
|
||||||
|
|
||||||
|
[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
|
||||||
|
[ -x $COMMAND ] && [ -r $CONFIG ] && {
|
||||||
|
killall ntpd
|
||||||
|
/etc/init.d/ntpd start
|
||||||
|
} &
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user