summaryrefslogtreecommitdiff
path: root/social/tinc/tincd.rcd
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-06-26 23:06:14 +0000
committerroot <root@rshg047.dnsready.net>2011-06-26 23:06:14 +0000
commit715631caf52784c47c8ed3aeb6cbdba2715a08db (patch)
treed1923d66cba8dcf90112f81ca31009202cff25a3 /social/tinc/tincd.rcd
parent8999fa1750304fb2367fb7743e49e013405e88be (diff)
Sun Jun 26 23:06:14 UTC 2011
Diffstat (limited to 'social/tinc/tincd.rcd')
-rw-r--r--social/tinc/tincd.rcd43
1 files changed, 43 insertions, 0 deletions
diff --git a/social/tinc/tincd.rcd b/social/tinc/tincd.rcd
new file mode 100644
index 000000000..f0a456e17
--- /dev/null
+++ b/social/tinc/tincd.rcd
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+daemon_name=tincd
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/$daemon_name.conf
+
+PID=`pidof -o %PPID /usr/sbin/tincd`
+
+case "$1" in
+ start)
+ stat_busy "Starting ${daemon_name}"
+ [ -z "$PID" ] && \
+ /usr/sbin/tincd -n ${NETNAME} \
+ --pidfile=/var/run/tinc.${NETNAME} &> /dev/null
+
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon ${daemon_name}
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping ${daemon_name}"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon ${daemon_name}
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0