fix portal/dns gre issues 47/4447/1
authorMarco Platania <platania@research.att.com>
Tue, 23 May 2017 19:21:37 +0000 (15:21 -0400)
committerMarco Platania <platania@research.att.com>
Tue, 23 May 2017 19:21:37 +0000 (15:21 -0400)
Change-Id: I652e5d8d4389b95feec8ec8b3b953748d3644d41
Signed-off-by: Marco Platania <platania@research.att.com>
boot/portal_vm_init.sh
vnfs/vLB/scripts/set_gre_tunnel.sh

index e7ecfe5..f6c0e75 100644 (file)
@@ -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
index aaad66c..15c884c 100644 (file)
@@ -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