Skip to content

Commit 5356e95

Browse files
authored
Fixing a bug that caused $pub_ip is always empty string
Putting update-firewall before getting $pub_ip is fixing this issue
1 parent 6531834 commit 5356e95

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

install/vst-install-debian.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,11 @@ $VESTA/bin/v-update-sys-ip
11771177
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
11781178
copy_of_ip=$ip
11791179

1180+
# Firewall configuration
1181+
if [ "$iptables" = 'yes' ]; then
1182+
$VESTA/bin/v-update-firewall
1183+
fi
1184+
11801185
# Get public ip
11811186
pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
11821187

@@ -1185,15 +1190,9 @@ if [ ! -z "$pub_ip" ] && [ "$pub_ip" != "$ip" ]; then
11851190
ip=$pub_ip
11861191
fi
11871192

1188-
# Firewall configuration
1189-
if [ "$iptables" = 'yes' ]; then
1190-
$VESTA/bin/v-update-firewall
1191-
fi
1192-
11931193
# Configuring libapache2-mod-remoteip
11941194
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
1195-
# Get public ip after firewall update
1196-
copy_of_pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
1195+
copy_of_pub_ip=$pub_ip
11971196
echo "<IfModule mod_remoteip.c>" > /etc/apache2/mods-available/remoteip.conf
11981197
echo " RemoteIPHeader X-Real-IP" >> /etc/apache2/mods-available/remoteip.conf
11991198
if [ "$copy_of_ip" != "127.0.0.1" ] && [ "$copy_of_pub_ip" != "127.0.0.1" ]; then

0 commit comments

Comments
 (0)