summaryrefslogtreecommitdiff
path: root/testing/ypbind-mt/ypbind
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-09-13 23:14:39 +0000
committerroot <root@rshg054.dnsready.net>2011-09-13 23:14:39 +0000
commita712dc92423a31a4d3ab34fe660df550feebf442 (patch)
treead93851f4343f00cec2f901e4839da01a8b77efe /testing/ypbind-mt/ypbind
parentb3a841a1f66eff75be29fba090b83ce4322d4721 (diff)
Tue Sep 13 23:14:39 UTC 2011
Diffstat (limited to 'testing/ypbind-mt/ypbind')
-rwxr-xr-xtesting/ypbind-mt/ypbind35
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/ypbind-mt/ypbind b/testing/ypbind-mt/ypbind
new file mode 100755
index 000000000..6a5ef11e3
--- /dev/null
+++ b/testing/ypbind-mt/ypbind
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+. /etc/conf.d/ypbind
+. /etc/conf.d/nisdomainname
+
+name=ypbind
+PID=$(pidof -o %PPID /usr/sbin/ypbind)
+
+case "$1" in
+start)
+ stat_busy "Starting $name daemon"
+ [[ -n $NISDOMAINNAME ]] && /usr/bin/domainname "$NISDOMAINNAME" &>/dev/null
+ [[ -z "$PID" ]] && /usr/sbin/ypbind $YPBIND_ARGS &>/dev/null \
+ && { add_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+stop)
+ stat_busy "Stopping $name daemon"
+ [[ -n "$PID" ]] && kill $PID &>/dev/null \
+ && { rm_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac