summaryrefslogtreecommitdiffstats
path: root/sdnvpn/artifacts/quagga_setup.sh
diff options
context:
space:
mode:
authorRomanos Skiadas <rski@intracom-telecom.com>2017-03-17 10:55:28 +0200
committertomsou <soth@intracom-telecom.com>2017-03-22 15:04:11 +0000
commitb5b2a3abd74f84943cf3fab7ca7da591d326661c (patch)
treeea7824d4f69c514f5142354194bbcea5ff92c562 /sdnvpn/artifacts/quagga_setup.sh
parentf7a6f2593a1b99a0bd0459093d606dd4bdbb999a (diff)
Testcase 3 Apex compatibility fixes
- Workaround a bug releng in getting opedaylight nodes - Add some sudo commands because the path is not properly set otherwise it seems - remove needless command that gets ip information from the compute, since that is already available from when the command was ran on the controller - Handle attaching the quagga instance to Apex's br-ex ovs bridge Change-Id: I870f1049d9cce696ec26376a09db5f9e9bac0bf9 Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com>
Diffstat (limited to 'sdnvpn/artifacts/quagga_setup.sh')
-rw-r--r--sdnvpn/artifacts/quagga_setup.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/sdnvpn/artifacts/quagga_setup.sh b/sdnvpn/artifacts/quagga_setup.sh
index 96d7374..6e61d9a 100644
--- a/sdnvpn/artifacts/quagga_setup.sh
+++ b/sdnvpn/artifacts/quagga_setup.sh
@@ -20,8 +20,27 @@ OWN_IP=%s
# directly access the instance from the external net without NAT
EXT_NET_MASK=%s
-ip link set ens7 up
-ip addr add $OWN_IP/$EXT_NET_MASK dev ens7
+if [[ $(getent hosts | awk '{print $2}') != *"$(cat /etc/hostname | awk '{print $1}')"* ]]
+then
+echo "127.0.1.1 $(cat /etc/hostname | awk '{print $1}')" | tee -a /etc/hosts
+fi
+
+quagga_int=''
+for net_int in $(netstat -ia | awk 'NR>2{print $1}');
+do
+if [ -z "$(ifconfig | grep $net_int)" ]
+then
+quagga_int=$net_int
+break
+fi
+done
+if [ -z "$quagga_int" ]
+then
+echo 'No available network interface'
+fi
+
+ip link set $quagga_int up
+ip addr add $OWN_IP/$EXT_NET_MASK dev $quagga_int
ZEBRA_CONFIG_LOCATION="/etc/quagga/zebra.conf"
DAEMONS_FILE_LOCATION="/etc/quagga/daemons"