summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/scripts/rc1/xntp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/scripts/rc1/xntp')
-rw-r--r--contrib/ntp/scripts/rc1/xntp29
1 files changed, 29 insertions, 0 deletions
diff --git a/contrib/ntp/scripts/rc1/xntp b/contrib/ntp/scripts/rc1/xntp
new file mode 100644
index 0000000..227b943
--- /dev/null
+++ b/contrib/ntp/scripts/rc1/xntp
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+killproc() { # kill named processes
+ pid=`/usr/bin/ps -e |
+ /usr/bin/grep $1 |
+ /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
+ [ "$pid" != "" ] && kill $pid
+}
+
+case "$1" in
+'start')
+ ps -e | grep xntpd > /dev/null 2>&1
+ if [ $? -eq 0 ]
+ then
+ echo "ntp daemon already running. ntp start aborted"
+ exit 0
+ fi
+ if [ -f /etc/inet/ntp.conf -a -x /usr/sbin/xntpd ]
+ then
+ /usr/sbin/xntpd -c /etc/inet/ntp.conf
+ fi
+ ;;
+'stop')
+ killproc xntpd
+ ;;
+*)
+ echo "Usage: /etc/init.d/xntp { start | stop }"
+ ;;
+esac
OpenPOWER on IntegriCloud