summaryrefslogtreecommitdiff
path: root/community/tinc/tincd.rc
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-12-20 23:14:59 +0000
committerroot <root@rshg054.dnsready.net>2011-12-20 23:14:59 +0000
commitea1f4bece8870857691a7123bdc899562760b3fe (patch)
treeb332a0692c3e63d46cb60cb1214fc57871e619c8 /community/tinc/tincd.rc
parent6d2dec5c3443d142a0131c43666929490961c16a (diff)
Tue Dec 20 23:14:59 UTC 2011
Diffstat (limited to 'community/tinc/tincd.rc')
-rw-r--r--community/tinc/tincd.rc42
1 files changed, 42 insertions, 0 deletions
diff --git a/community/tinc/tincd.rc b/community/tinc/tincd.rc
new file mode 100644
index 000000000..48c132f25
--- /dev/null
+++ b/community/tinc/tincd.rc
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+daemon_name=tincd
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/$daemon_name.conf
+
+case "$1" in
+ start)
+ for net in "${NETNAMES[@]}"; do
+ stat_busy "Starting ${daemon_name}"
+ /usr/sbin/tincd -n "${net}" $TINCD_EXTRAOPTS &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon ${daemon_name}
+ stat_done
+ fi
+ done
+ ;;
+ stop)
+ stat_busy "Stopping ${daemon_name}"
+ for net in "${NETNAMES[@]}"; do
+ /usr/sbin/tincd -k -n "${net}" &>/dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon ${daemon_name}
+ stat_done
+ fi
+ done
+ ;;
+ restart)
+ "$0" stop
+ sleep 5
+ "$0" start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0