summaryrefslogtreecommitdiff
blob: b790544a50b842d5bdf082ba28d9b77a7378d34b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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/vde/files/vde.init,v 1.3 2008/03/11 21:34:49 genstef Exp $

depend() {
	after net.${VDE_TAP}
}


start() {
	ebegin "Starting vde"
	[ "${VDE_MODPROBE_TUN}" == "yes" ] && modprobe tun
	start-stop-daemon --start --quiet \
		--exec /usr/bin/vde_switch -- -tap ${VDE_TAP} -daemon
	eend $? "Failed to start vde"
	chmod -R ${VDE_SOCK_CHMOD} /var/run/vde.ctl
	chown -R ${VDE_SOCK_CHOWN} /var/run/vde.ctl
}

stop() {
	ebegin "Stopping vde"
	[ "${VDE_MODPROBE_TUN}" == "yes" ] && modprobe -r tun
	start-stop-daemon --stop --quiet --exec /usr/bin/vde_switch
	eend $? "Failed to stop vde"
}