Browse Source

check if nat not already set before applying nat rule

HgO 1 year ago
parent
commit
6ef195c867
1 changed files with 3 additions and 1 deletions
  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