AFixd applying nopublick option

This commit is contained in:
Alexey Berezhok
2024-06-12 15:58:13 +03:00
parent 694825461a
commit 12d787ea87
4 changed files with 26 additions and 9 deletions

View File

@@ -167,11 +167,16 @@ for ip in $ips; do
done
# Updating NAT
pub_ipv4="$(curl -fsLm5 --retry 2 --ipv4 https://ip.hestiacp.com/)"
if [ ! -e "$HESTIA/data/ips/$pub_ipv4" ]; then
if [ -z "$(grep -R "$pub_ipv4" $HESTIA/data/ips/)" ]; then
ip="$(ls -t $HESTIA/data/ips/ | head -n1)"
$BIN/v-change-sys-ip-nat "$ip" "$pub_ipv4"
if [ -e $HESTIA/conf/nopublickip ]; then
ip="$(ls -t $HESTIA/data/ips/ | head -n1)"
$BIN/v-change-sys-ip-nat "$ip" "$ip"
else
pub_ipv4="$(curl -fsLm5 --retry 2 --ipv4 https://ip.hestiacp.com/)"
if [ ! -e "$HESTIA/data/ips/$pub_ipv4" ]; then
if [ -z "$(grep -R "$pub_ipv4" $HESTIA/data/ips/)" ]; then
ip="$(ls -t $HESTIA/data/ips/ | head -n1)"
$BIN/v-change-sys-ip-nat "$ip" "$pub_ipv4"
fi
fi
fi