From: Marco Platania Date: Tue, 23 May 2017 19:21:37 +0000 (-0400) Subject: fix portal/dns gre issues X-Git-Tag: 1.0.0-Amsterdam~278 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F4447%2F1;p=demo.git fix portal/dns gre issues Change-Id: I652e5d8d4389b95feec8ec8b3b953748d3644d41 Signed-off-by: Marco Platania --- diff --git a/boot/portal_vm_init.sh b/boot/portal_vm_init.sh index e7ecfe54..f6c0e75c 100644 --- a/boot/portal_vm_init.sh +++ b/boot/portal_vm_init.sh @@ -35,12 +35,17 @@ sleep 180 if [ ! -e /opt/config/boot.txt ] then - if [ -e /opt/config/public_ip.txt ] - then - IP_ADDRESS=$(cat /opt/config/public_ip.txt) - else - IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) - fi - mysql -u root -p'Aa123456' -h $IP_ADDRESS < /opt/portal/deliveries/Apps_Users_OnBoarding_Script.sql - echo "yes" > /opt/config/boot.txt + if [ -e /opt/config/public_ip.txt ] + then + IP_ADDRESS=$(cat /opt/config/public_ip.txt) + else + IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) + fi + # Wait until MySQL is running... + while [[ $(netstat -vulntp |grep -i mysql | awk '{print $4}') != ":::3306" ]] + do + sleep 1 + done + mysql -u root -p'Aa123456' -h $IP_ADDRESS < /opt/portal/deliveries/Apps_Users_OnBoarding_Script.sql + echo "yes" > /opt/config/boot.txt fi diff --git a/vnfs/vLB/scripts/set_gre_tunnel.sh b/vnfs/vLB/scripts/set_gre_tunnel.sh index aaad66c1..15c884c0 100644 --- a/vnfs/vLB/scripts/set_gre_tunnel.sh +++ b/vnfs/vLB/scripts/set_gre_tunnel.sh @@ -9,14 +9,13 @@ fi LB_PUBLIC_IP=$1 LB_PRIVATE_IP=$(cat /opt/config/lb_private_ipaddr.txt) MY_PRIVATE_IP=$(cat /opt/config/local_private_ipaddr.txt) -OLD_GW=$(route -n | grep "^0.0.0.0" | awk '{print $2}') sed -i "s/x.x.x.x/"$LB_PUBLIC_IP"/g" /etc/bind/named.conf.options ip tunnel add gre123 mode gre remote $LB_PRIVATE_IP local $MY_PRIVATE_IP ttl 255 ip link set gre123 up ip addr add $LB_PUBLIC_IP"/32" dev gre123 -route del default gw $OLD_GW route add default dev gre123 +ifconfig eth0 down service bind9 restart