Commit be804236 authored by Lionel Gauthier's avatar Lionel Gauthier

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5137 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent d4e6575a
...@@ -325,72 +325,75 @@ check_for_root_rights() { ...@@ -325,72 +325,75 @@ check_for_root_rights() {
} }
is_openvswitch_interface() { is_openvswitch_interface() {
if [ "a$1" == "a" ]; then for var in "$@"
do
if [ "a$var" == "a" ]; then
return 0 return 0
fi fi
if [ "a${1:0:3}" == "aeth" ]; then if [ "a${var:0:3}" == "aeth" ]; then
return 0; return 0;
else else
if [ "a${1:0:4}" == "awlan" ]; then if [ "a${var:0:4}" == "awlan" ]; then
return 0; return 0;
else else
if [ "a${1:0:4}" == "awifi" ]; then if [ "a${var:0:4}" == "awifi" ]; then
return 0; return 0;
else else
if [ "a${1:0:4}" == "anone" ]; then if [ "a${var:0:4}" == "anone" ]; then
return 0; return 0;
fi fi
fi fi
fi fi
fi fi
done
return 1; return 1;
} }
is_real_interface() { is_real_interface() {
if [ "a$1" == "a" ]; then my_bool=1
for var in "$@"
do
if [ "a$var" == "a" ]; then
return 0 return 0
fi fi
IF=`cat /etc/udev/rules.d/70-persistent-net.rules | grep $1 | sed 's/^.*NAME=//' | tr -d '"'` IF=`cat /etc/udev/rules.d/70-persistent-net.rules | grep $var | sed 's/^.*NAME=//' | tr -d '"'`
if [ "$IF" == "$1" ]; then if [ "$IF" == "$var" ]; then
if [ "a${1:0:3}" == "aeth" ]; then if [ "a${var:0:3}" != "aeth" ]; then
return 1; if [ "a${var:0:4}" != "awlan" ]; then
else if [ "a${var:0:4}" != "awifi" ]; then
if [ "a${1:0:4}" == "awlan" ]; then my_bool=0;
return 1;
else
if [ "a${1:0:4}" == "awifi" ]; then
return 1;
fi fi
fi fi
fi fi
fi fi
return 0 done
return $my_bool
} }
is_vlan_interface() { is_vlan_interface() {
if [ "a$1" == "a" ]; then my_bool=1
return 0 for var in "$@"
do
if [ "a$var" == "a" ]; then
my_bool=0
fi fi
if [[ $1 == *.* ]] if [[ $var == *.* ]]
then then
interface_name=`echo $1 | cut -f1 -d '.'` interface_name=`echo $var | cut -f1 -d '.'`
vlan=`echo $1 | cut -f2 -d '.'` vlan=`echo $var | cut -f2 -d '.'`
IF=`cat /etc/udev/rules.d/70-persistent-net.rules | grep $interface_name | sed 's/^.*NAME=//' | tr -d '"'` IF=`cat /etc/udev/rules.d/70-persistent-net.rules | grep $interface_name | sed 's/^.*NAME=//' | tr -d '"'`
if [ "$IF" == "$interface_name" ]; then if [ "$IF" == "$interface_name" ]; then
if [ "a${interface_name:0:3}" == "aeth" ]; then if [ "a${interface_name:0:3}" != "aeth" ]; then
return 1; if [ "a${interface_name:0:4}" != "awlan" ]; then
else if [ "a${interface_name:0:4}" != "awifi" ]; then
if [ "a${interface_name:0:4}" == "awlan" ]; then my_bool=0;
return 1;
else
if [ "a${interface_name:0:4}" == "awifi" ]; then
return 1;
fi fi
fi fi
fi fi
fi fi
fi fi
return 0 done
return $my_bool
} }
...@@ -955,6 +958,8 @@ build_epc_ovs_network() { ...@@ -955,6 +958,8 @@ build_epc_ovs_network() {
sync sync
bash_exec "vconfig add $PGW_INTERFACE_NAME_FOR_SGI $i" bash_exec "vconfig add $PGW_INTERFACE_NAME_FOR_SGI $i"
sync sync
bash_exec "ifconfig $PGW_INTERFACE_NAME_FOR_SGI.$i up"
sync
# configure vlan interface # configure vlan interface
#CIDR=$NETWORK'.'$i'/24' #CIDR=$NETWORK'.'$i'/24'
base=200 base=200
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment