1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00

check if nat not already set before applying nat rule

This commit is contained in:
HgO 2023-11-18 21:45:01 +01:00
parent 689f00983c
commit 6ef195c867

View file

@ -25,7 +25,9 @@ if systemctl is-active __SERVICE_NAME__; then
unset_nat "${old_gateway_interface}"
fi
set_nat "${new_gateway_interface}"
if [[ -n "$new_gateway_interface" ]] && ! is_nat_set $new_gateway_interface; then
set_nat "${new_gateway_interface}"
fi
ynh_app_setting_set --app=__APP__ --key=gateway_interface --value="${new_gateway_interface}"
fi