From e725d58f7bfdc815c0a3f37cb286f64b32fdc05a Mon Sep 17 00:00:00 2001 From: Lab-8916100448256 <38373466+Lab-8916100448256@users.noreply.github.com> Date: Fri, 8 Mar 2024 18:14:50 +0100 Subject: [PATCH] Fix issue of gateway interface detection in the case of VPN usage --- conf/ynh-hotspot | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/ynh-hotspot b/conf/ynh-hotspot index e9460df..928b54b 100644 --- a/conf/ynh-hotspot +++ b/conf/ynh-hotspot @@ -236,8 +236,7 @@ if [ "$1" != restart ]; then 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) - 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" fi