All pastes #433452 Raw Edit

Something

public text v1 · immutable
·published 2007-04-10 20:18 UTC
rendered paste body
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/vtun/files/vtun.rc,v 1.8 2004/07/15 00:15:45 agriffis Exp $

depend() {
        need net
}

start() {
        IFS=$'\n'
        for line in `grep -v '^[[:space:]]*#' /etc/vtund-start.conf | grep -v '^[[:space:]]*$'`
        do
                echo $line |
                        (IFS=" "
                         read host server args
                         if [ "$host" = "--server--" ]; then
                                 ebegin "Starting vtund server"
                                 /usr/sbin/vtund -s -P $server $args
                                 eend $?
                         else
                                 ebegin "Starting vtund client $host to $server"
                                 /usr/sbin/vtund $args -- $host $server
                                 eend $?
                         fi)
        done
}

stop() {
        ebegin "Stopping all vtund servers and clients"
        killall vtund
        eend $?
}