diff options
-rw-r--r-- | boot/portal_vm_init.sh | 21 | ||||
-rw-r--r-- | vnfs/vLB/scripts/set_gre_tunnel.sh | 3 |
2 files changed, 14 insertions, 10 deletions
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 |