Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 157987 | Differences between
and this patch

Collapse All | Expand All

(-)scripts/qemu-ifup.orig (-4 / +18 lines)
Lines 1-5 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
2
cmd=""
3
switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
3
if [ "$EUID" != 0 ]; then 
4
/sbin/ifconfig $1 0.0.0.0 up
4
	if [ -x "/usr/bin/sudo" ]; then
5
/usr/sbin/brctl addif ${switch} $1
5
		cmd="/usr/bin/sudo "
6
	else 
7
		echo "You must have sudo or root privileges to bring up a network interface"
8
		exit 0
9
	fi
10
fi
11
echo "Bringing up interface $1"
12
switch=$(/sbin/ip route list | awk '/^default / { print $5 }')
13
if [[ $(/sbin/ifconfig | grep -c $1) -gt 0 ]]; then
14
       	${cmd}/sbin/brctl delif ${switch} $1
15
	${cmd}/sbin/ifconfig $1 down
16
fi
17
${cmd}/usr/bin/tunctl -u $(/usr/bin/whoami) -t $1
18
${cmd}/sbin/ifconfig $1 0.0.0.0 promisc up
19
${cmd}/sbin/brctl addif ${switch} $1

Return to bug 157987