summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Blumenstein <bazik@gentoo.org>2003-12-24 14:24:01 +0000
committerSven Blumenstein <bazik@gentoo.org>2003-12-24 14:24:01 +0000
commiteb2f40f047349b3eabc3d91105e3f238939c3071 (patch)
tree7891f3ce433b676f5c4d21fa83e85b5f2b25a641 /net-misc/tinc/files
parentbash-completion-20031125-r1 removed (diff)
downloadhistorical-eb2f40f047349b3eabc3d91105e3f238939c3071.tar.gz
historical-eb2f40f047349b3eabc3d91105e3f238939c3071.tar.bz2
historical-eb2f40f047349b3eabc3d91105e3f238939c3071.zip
Fixed init script and added ~sparc keyword.
Diffstat (limited to 'net-misc/tinc/files')
-rw-r--r--net-misc/tinc/files/tincd51
1 files changed, 51 insertions, 0 deletions
diff --git a/net-misc/tinc/files/tincd b/net-misc/tinc/files/tincd
new file mode 100644
index 000000000000..225a7caa83e7
--- /dev/null
+++ b/net-misc/tinc/files/tincd
@@ -0,0 +1,51 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd,v 1.1 2003/12/24 14:23:51 bazik Exp $
+
+
+depend() {
+ use logger dns
+ need net
+}
+
+checkconfig() {
+ if [ ! `grep -c '^ *NETWORK:' /etc/conf.d/tinc.networks` > 0 ]
+ then
+ eerror "No VPN networks configured in /etc/conf.d/tinc.networks"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting tinc VPN networks"
+ eend 0
+ cat /etc/conf.d/tinc.networks | grep '^ *NETWORK:' | awk '{ print $2 }' | while read TINCNET
+ do
+ if [ ! -f /etc/tinc/$TINCNET/tinc.conf ]
+ then
+ eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !"
+ else
+ ebegin "Starting tinc network $TINCNET"
+ /usr/sbin/tincd --net=$TINCNET --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid
+ eend $?
+ fi
+ done
+}
+
+stop() {
+ ebegin "Stopping tinc VPN networks"
+ eend 0
+ cat /etc/conf.d/tinc.networks | grep '^ *NETWORK:' | awk '{ print $2 }' | while read TINCNET
+ do
+ if [ -f /var/run/tinc.$TINCNET.pid ]
+ then
+ ebegin "Stopping tinc network $TINCNET"
+ /usr/sbin/tincd --kill=9 `cat /var/run/tinc.$TINCNET.pid` --pidfile=/var/run/tinc.$TINCNET.pid
+ eend $?
+ #rm -f /var/run/tinc.$TINCNET.pid
+ fi
+ done
+}
+