summaryrefslogtreecommitdiff
blob: edef1f39f60874c0f9cc7c1bf64077235bf8b1ee (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later

extra_commands="checkconfig"

checkconfig() {
	if [ -z "${INTERFACES}" ]; then
		eerror "INTERFACES should be set. PLease edit /etc/conf.d/gvrpcd"
		return 1
	fi
	if [ ! -d /proc/net/vlan ]; then
		modprobe 8021q
		if [ ! -d /proc/net/vlan ]; then
			eerror "VLAN (802.1q) support is not present in this kernel"
			return 1
		fi
	fi
}

depend() {
	need net
}

start() {
	checkconfig || return 1
	ebegin "Starting gvrpcd"
	for IFNAME in ${INTERFACES}; do
		ebegin "	on interface ${IFNAME}"
		start-stop-daemon --start \
			--pidfile /var/run/gvrpcd-${IFNAME}.pid \
			--exec /usr/sbin/gvrpcd \
			-- -d -p /var/run/gvrpcd-${IFNAME}.pid \
			-i "${IFNAME}" ${EXTRA_ARGS}
		eend $?
	done
#	eend $?
}

stop() {
	ebegin "Stoping gvrpcd"
	for IFNAME in ${INTERFACES}; do
		ebegin "	on interface ${IFNAME}"
		start-stop-daemon --stop --exec /usr/sbin/gvrpcd \
			-p /var/run/gvrpcd-${IFNAME}.pid
		eend $?
	done
#	eend $?
}