Parcourir la source

check if nat not already set before applying nat rule

HgO il y a 1 an
Parent
commit
6ef195c867
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      conf/openvpn_90-hotspot

+ 3 - 1
conf/openvpn_90-hotspot

@@ -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