summaryrefslogtreecommitdiff
path: root/network/openntpd/rc.openntpd
diff options
context:
space:
mode:
authorLEVAI Daniel <leva@ecentrum.hu>2015-01-09 07:10:40 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-01-09 07:10:40 +0700
commit36f101a0ebf2c62c3293f06d415958bd22621604 (patch)
tree3977fae6d4c036e52262411f0b9e441d9c8f07f0 /network/openntpd/rc.openntpd
parent9ab32a1f296c23ce646fc080bf20e7f57c164b8d (diff)
downloadslackbuilds-36f101a0ebf2c62c3293f06d415958bd22621604.tar.gz
network/openntpd: Added (Network Time Protocol client/server).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/openntpd/rc.openntpd')
-rw-r--r--network/openntpd/rc.openntpd43
1 files changed, 43 insertions, 0 deletions
diff --git a/network/openntpd/rc.openntpd b/network/openntpd/rc.openntpd
new file mode 100644
index 0000000000..52206765cf
--- /dev/null
+++ b/network/openntpd/rc.openntpd
@@ -0,0 +1,43 @@
+#!/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
+
+openntpd_start() {
+ if [ -x ${BIN} ]; then
+ echo "Starting openntpd daemon: ${BIN}"
+ ${BIN} -p /var/run/openntpd.pid
+ fi
+}
+
+openntpd_stop() {
+ echo "Stopping openntpd daemon..."
+ pkill -x $(basename ${BIN})
+}
+
+openntpd_restart() {
+ openntpd_stop
+ sleep 1
+ openntpd_start
+}
+
+BIN=/usr/sbin/openntpd
+
+case "$1" in
+ 'start')
+ openntpd_start
+ ;;
+ 'stop')
+ openntpd_stop
+ ;;
+ 'restart')
+ openntpd_restart
+ ;;
+ *)
+ echo "usage $0 start|stop|restart"
+ ;;
+esac