summaryrefslogtreecommitdiff
path: root/package/busybox/files/ntpd.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/busybox/files/ntpd.init')
-rw-r--r--package/busybox/files/ntpd.init27
1 files changed, 27 insertions, 0 deletions
diff --git a/package/busybox/files/ntpd.init b/package/busybox/files/ntpd.init
new file mode 100644
index 000000000..180f161a7
--- /dev/null
+++ b/package/busybox/files/ntpd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#PKG busybox
+#INIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${ntpd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/ntpd $ntpd_flags
+ ;;
+stop)
+ kill $(pgrep -f /usr/sbin/ntpd)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?