Fixing a bug that caused $pub_ip is always empty string

Putting update-firewall before getting $pub_ip is fixing this issue
This commit is contained in:
dpeca 2016-10-24 18:22:49 +02:00 committed by GitHub
commit 862e26200c

View file

@ -1226,6 +1226,11 @@ $VESTA/bin/v-update-sys-ip
# Get main ip
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
# Firewall configuration
if [ "$iptables" = 'yes' ]; then
$VESTA/bin/v-update-firewall
fi
# Get public ip
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
@ -1233,11 +1238,6 @@ if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
ip=$pub_ip
fi
# Firewall configuration
if [ "$iptables" = 'yes' ]; then
$VESTA/bin/v-update-firewall
fi
# Configuring mysql host
if [ "$mysql" = 'yes' ]; then
$VESTA/bin/v-add-database-host mysql localhost root $vpass