Explorar el Código

Fixing a bug that caused $pub_ip is always empty string

Putting update-firewall before getting $pub_ip is fixing this issue
dpeca hace 9 años
padre
commit
6a955cd794
Se han modificado 1 ficheros con 5 adiciones y 5 borrados
  1. 5 5
      install/vst-install-ubuntu.sh

+ 5 - 5
install/vst-install-ubuntu.sh

@@ -1125,6 +1125,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
@@ -1132,11 +1137,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