Parcourir la source

Fix issue of gateway interface detection in the case of VPN usage

Lab-8916100448256 il y a 1 an
Parent
commit
e725d58f7b
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      conf/ynh-hotspot

+ 1 - 2
conf/ynh-hotspot

@@ -236,8 +236,7 @@ if [ "$1" != restart ]; then
     ip4_nat_prefix=$(ynh_app_setting_get --app=$app --key=ip4_nat_prefix)
     ip4_nat_prefix=$(ynh_app_setting_get --app=$app --key=ip4_nat_prefix)
 
 
     old_gateway_interface=$(ynh_app_setting_get --app=$app --key=gateway_interface)
     old_gateway_interface=$(ynh_app_setting_get --app=$app --key=gateway_interface)
-    new_gateway_interface=$(ip route get 1.2.3.4 | awk '{ print $5; }')
-
+    new_gateway_interface=$(ip route get 1.2.3.4 | awk '$2 ~ /^dev$/ { print $3; } $4 ~ /^dev$/ { print $5; }')
     echo "OK"
     echo "OK"
 fi
 fi