diff options
Diffstat (limited to 'testing/tinc/tincd.lo.initd')
-rw-r--r-- | testing/tinc/tincd.lo.initd | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/tinc/tincd.lo.initd b/testing/tinc/tincd.lo.initd new file mode 100644 index 000000000..79c185b38 --- /dev/null +++ b/testing/tinc/tincd.lo.initd @@ -0,0 +1,46 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd.lo,v 1.1 2010/07/18 10:04:56 dragonheart Exp $ + +opts="reload" + +depend() +{ + use logger dns + need net +} + +start() +{ + TINCNET=${RC_SVCNAME#*.} + if [ -f /etc/tinc/"$TINCNET"/tinc.conf ] ; then + ebegin "Starting tinc network $TINCNET" + /usr/sbin/tincd --debug=1 --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid + eend $? + else + eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !" + fi +} + +stop() +{ + TINCNET=${RC_SVCNAME#*.} + if [ -f /var/run/tinc."$TINCNET".pid ] ; then + ebegin "Stopping tinc network $TINCNET" + /usr/sbin/tincd --kill --pidfile=/var/run/tinc."$TINCNET".pid + eend $? + else + eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !" + fi +} + +reload() +{ + TINCNET=${RC_SVCNAME#*.} + if [ -f /var/run/tinc."$TINCNET".pid ] ; then + ebegin "Reloading configuration for tinc network $TINCNET" + /usr/sbin/tincd --kill HUP --pidfile=/var/run/tinc."$TINCNET".pid + eend $? + fi +} |