git://git.onelab.eu
/
tests.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ignore result of slice_fs_deleted
[tests.git]
/
system
/
template-qemu
/
qemu-bridge-init
diff --git
a/system/template-qemu/qemu-bridge-init
b/system/template-qemu/qemu-bridge-init
index
399907c
..
d182557
100755
(executable)
--- a/
system/template-qemu/qemu-bridge-init
+++ b/
system/template-qemu/qemu-bridge-init
@@
-17,7
+17,7
@@
set -x
# constant
INTERFACE_BRIDGE=br0
# constant
INTERFACE_BRIDGE=br0
-#
Default Value for
INTERFACE_LAN
+#
################### compute
INTERFACE_LAN
# use /proc/net/dev instead of a hard-wired list
function gather_interfaces () {
python <<EOF
# use /proc/net/dev instead of a hard-wired list
function gather_interfaces () {
python <<EOF
@@
-25,23
+25,24
@@
for line in file("/proc/net/dev"):
if ':' not in line: continue
ifname=line.replace(" ","").split(":")[0]
if ifname.find("lo")==0: continue
if ':' not in line: continue
ifname=line.replace(" ","").split(":")[0]
if ifname.find("lo")==0: continue
+ if ifname.find("br")==0: continue
if ifname.find("virbr")==0: continue
if ifname.find("tap")==0: continue
print ifname
EOF
}
if ifname.find("virbr")==0: continue
if ifname.find("tap")==0: continue
print ifname
EOF
}
-# let's try to figure out the interface to use - try these in order
function discover_interface () {
for ifname in $(gather_interfaces); do
function discover_interface () {
for ifname in $(gather_interfaces); do
- ip link show $ifname | grep -qi 'state UP' && {
INTERFACE_LAN=
$ifname; return; }
+ ip link show $ifname | grep -qi 'state UP' && {
echo
$ifname; return; }
done
# still not found ? that's bad
done
# still not found ? that's bad
-
INTERFACE_LAN=
unknown
+
echo
unknown
}
}
-discover_interface
-echo $INTERFACE_LAN
+INTERFACE_LAN=$(discover_interface)
+echo
Using physical interface
$INTERFACE_LAN
+####################
# Fonction de mise en place du pont
function start () {
# Fonction de mise en place du pont
function start () {