if ifname.find("virbr")==0: continue
if ifname.find("veth")==0: continue
if ifname.find("tap")==0: continue
+ if ifname.find("vif")==0: continue
print ifname
EOF
}
function discover_interface () {
for ifname in $(gather_interfaces); do
- ip link show $ifname | grep -qi 'state UP' && { echo $ifname; return; }
+ ip link show $ifname | grep -qi 'state UP' && { echo $ifname; return; }
done
# still not found ? that's bad
echo unknown
}
+##############################
+function check_yum_installed () {
+ package=$1; shift
+ rpm -q $package >& /dev/null || yum -y install $package
+}
+
+# not used apparently
+function check_yumgroup_installed () {
+ group="$1"; shift
+ yum grouplist "$group" | grep -q Installed || { yum -y groupinstall "$group" ; }
+}
+
#################### bridge initialization
function create_bridge_if_needed() {
- # turn on verbosity
- set -x
+ # do not turn on verbosity
+ # set -x
public_bridge=$1; shift
# already created ? - we're done
ip addr show $public_bridge >& /dev/null && {
- echo "Bridge already set up - skipping create_bridge_if_needed"
- return 0
+ echo "Bridge already set up - skipping create_bridge_if_needed"
+ return 0
}
# find out the physical interface to bridge onto
function main () {
if [[ -n "$@" ]] ; then
- public_bridge="$1"; shift
+ public_bridge="$1"; shift
else
- public_bridge="$DEFAULT_PUBLIC_BRIDGE"
+ public_bridge="$DEFAULT_PUBLIC_BRIDGE"
fi
create_bridge_if_needed $public_bridge
}