From 0517eab29a7fda6160296f42e603da77c11cb317 Mon Sep 17 00:00:00 2001 From: "Brian J. Tarricone" Date: Mon, 12 Aug 2024 18:25:46 -0700 Subject: [PATCH] Try harder to determine interface device names And also allow the wan-failover config to override it in case it's not in the network config, which it seems like it isn't anymore. --- wan-failover | 4 ++-- wan-failover.config | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wan-failover b/wan-failover index fde9d1f..7d4b842 100755 --- a/wan-failover +++ b/wan-failover @@ -50,9 +50,9 @@ cfg_init() { check_interval=$(ourcfg globals.check_interval || echo $default_check_interval) primary_iface=$(ourcfg globals.primary || echo '') - primary_ifname=$(cfg network.$primary_iface.ifname || echo '') + primary_ifname=$(ourcfg wan.ifname || cfg network.$primary_iface.ifname || cfg network.$primary_iface.device || echo '') fallback_iface=$(ourcfg globals.fallback || echo '') - fallback_ifname=$(cfg network.$fallback_iface.ifname || echo '') + fallback_ifname=$(ourcfg wwan.ifname || cfg network.$fallback_iface.ifname || cfg network.$fallback_iface.device || echo '') primary_health_ips=$(ourcfg $primary_iface.ip || echo $default_health_ips) primary_ping_count=$(ourcfg $primary_iface.count || echo $default_ping_count) diff --git a/wan-failover.config b/wan-failover.config index 3f4f172..e6c53a8 100644 --- a/wan-failover.config +++ b/wan-failover.config @@ -14,6 +14,7 @@ config interface 'wan' option timeout '2' option down '3' option up '5' +# option ifname 'eth2' config interface 'wwan' list ip '8.8.8.8' @@ -25,3 +26,4 @@ config interface 'wwan' option timeout '2' option down '3' option up '5' +# option ifname 'wwan0'