summaryrefslogtreecommitdiff
path: root/packages/ntp
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2005-02-13 10:59:32 +0000
committerKoen Kooi <koen@openembedded.org>2005-02-13 10:59:32 +0000
commit4d78352c09f3da769c39d8dbad6e673e341ccef0 (patch)
tree9828e5b90acdcd9aac4f25150b2d98e893069157 /packages/ntp
parentc0519a14bc34317db582d2fe4afafe4376228cac (diff)
ntpdate:
fix PATH BKrev: 420f3314UbqbGmuP8hXXHY7QYmi2Vg
Diffstat (limited to 'packages/ntp')
-rw-r--r--packages/ntp/files/ntpdate34
1 files changed, 34 insertions, 0 deletions
diff --git a/packages/ntp/files/ntpdate b/packages/ntp/files/ntpdate
index e69de29bb2..b9963b772a 100644
--- a/packages/ntp/files/ntpdate
+++ b/packages/ntp/files/ntpdate
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/bin
+
+test -f /usr/bin/ntpdate || exit 0
+
+if test -f /etc/default/ntpdate ; then
+. /etc/default/ntpdate
+else
+NTPSERVERS="pool.ntp.org"
+fi
+
+test -n "$NTPSERVERS" || exit 0
+
+case "$1" in
+start|force-reload)
+ echo -n "Running ntpdate to synchronize clock"
+ /usr/bin/ntpdate -u -b -s $NTPOPTIONS $NTPSERVERS
+ echo "."
+ ;;
+restart|reload)
+ # Drop -b to slew clock rather than step it if called after system is up
+ echo -n "Running ntpdate to synchronize clock"
+ /usr/bin/ntpdate -u -s $NTPOPTIONS $NTPSERVERS
+ echo "."
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: /etc/init.d/ntpdate {start|stop|restart|reload|force-reload}"
+ exit 1
+esac
+
+exit 0