Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Aug 2004 16:00:43 +0200 (CEST)
From:      Divacky Roman <xdivac02@stud.fit.vutbr.cz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/69906: rc.d functionality for net/vtun
Message-ID:  <200408021400.i72E0hHr052044@eva.fit.vutbr.cz>
Resent-Message-ID: <200408021410.i72EAPLI046006@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         69906
>Category:       ports
>Synopsis:       rc.d functionality for net/vtun
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 02 14:10:25 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Divacky Roman
>Release:        FreeBSD 4.10-STABLE i386
>Organization:
home
>Environment:
System: FreeBSD eva.fit.vutbr.cz 4.10-STABLE FreeBSD 4.10-STABLE #6: Mon Jul 12 10:29:52 CEST 2004 root@tereza.fit.vutbr.cz:/home/src/sys/sys-49/compile/EVA i386


	
>Description:
	This implements rc.d functionality for ports/net/vtun. Starting and
	stoping. Works for me and its surely better than nothing.
>How-To-Repeat:
Put this into /usr/local/etc/rc.d/ and then set propriete things in
/etc/rc.conf
>Fix:
#!/bin/sh
# 

# PROVIDE: vtund
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: FreeBSD shutdown

#
# Add the following lines to /etc/rc.conf to enable vtund:
#
#vtund_enable="YES"
#
# and, for fine grain control
#
#vtund_session="foo"		# sets the session name (mandatory for client)
#vtund_server="some.server"	# sets the server name (mandatory for client)
#vtund_config="/etc/vtund.conf"	# to set special config file
#vtund_args=""			# additional arguments
#

. /etc/rc.subr

name=vtund
rcvar=`set_rcvar`
command="/usr/local/sbin/${name}"
start_precmd=":"
stop_cmd="vtund_stop"
start_cmd="vtund_start"

load_rc_config $name
# Set defaults
vtund_config=${vtund_config:-"/usr/local/etc/vtund.conf"}
# Config file is required
if [ ! -r ${vtund_config} ]; then
    warn "${vtund_config} is not readable."
    case $1 in
	force*) : ;;
	*) exit 1 ;;
    esac
fi

vtund_start() {
	case ${vtund_enable} in
	[Nn][Oo])
	;;
	*)
	/usr/local/sbin/${name} -f ${vtund_config} ${vtund_args} ${vtund_session} ${vtund_server} && echo -n 'vtund'
	;;
	esac

}

vtund_stop() {
	killall vtund && echo -n 'vtund'
}

load_rc_config $name
run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408021400.i72E0hHr052044>