mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
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:
parent
6531834def
commit
5356e95d2f
1 changed files with 6 additions and 7 deletions
|
@ -1177,6 +1177,11 @@ $VESTA/bin/v-update-sys-ip
|
|||
ip=$(ip addr|grep 'inet '|grep global|head -n1|awk '{print $2}'|cut -f1 -d/)
|
||||
copy_of_ip=$ip
|
||||
|
||||
# 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/)
|
||||
|
||||
|
@ -1185,15 +1190,9 @@ 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 libapache2-mod-remoteip
|
||||
if [ "$apache" = 'yes' ] && [ "$nginx" = 'yes' ] ; then
|
||||
# Get public ip after firewall update
|
||||
copy_of_pub_ip=$(curl -s vestacp.com/what-is-my-ip/)
|
||||
copy_of_pub_ip=$pub_ip
|
||||
echo "<IfModule mod_remoteip.c>" > /etc/apache2/mods-available/remoteip.conf
|
||||
echo " RemoteIPHeader X-Real-IP" >> /etc/apache2/mods-available/remoteip.conf
|
||||
if [ "$copy_of_ip" != "127.0.0.1" ] && [ "$copy_of_pub_ip" != "127.0.0.1" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue