diff options
author | Robby Workman <rw@rlworkman.net> | 2010-05-11 15:01:33 +0200 |
---|---|---|
committer | Piter PUNK <piterpk@slackbuilds.org> | 2010-05-11 15:01:33 +0200 |
commit | ff9b7ad258b1f6f0b13e8584ce1213f997e5253a (patch) | |
tree | 8289fa8c17a1f03a6a9b8772374edd2d87955924 /network/openntpd/rc.ntpd | |
parent | 456d07a8a92408f81fba2603c976897cc62f8ba5 (diff) |
network/openntpd: Initial import
Diffstat (limited to 'network/openntpd/rc.ntpd')
-rw-r--r-- | network/openntpd/rc.ntpd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/network/openntpd/rc.ntpd b/network/openntpd/rc.ntpd new file mode 100644 index 0000000000000..249df02de80bf --- /dev/null +++ b/network/openntpd/rc.ntpd @@ -0,0 +1,39 @@ +#!/bin/sh +# Start/stop/restart the network time protocol daemon +# +# Written for Slackware Linux by Robby Workman <http://rlworkman.net> +# ## (by modifying one of Pat's scripts) +# Add -s to the command to set the time at startup + +ntpd_start() { + if [ -x /usr/sbin/ntpd ]; then + echo "Starting ntpd daemon: /usr/sbin/ntpd " + /usr/sbin/ntpd 2> /dev/null + sleep 1 + fi +} + +ntpd_stop() { + echo "Stopping ntpd daemon..." + killall ntpd 2> /dev/null +} + +ntpd_restart() { + ntpd_stop + sleep 1 + ntpd_start +} + +case "$1" in +'start') + ntpd_start + ;; +'stop') + ntpd_stop + ;; +'restart') + ntpd_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |