From 48da3876262ec01b0b14f3e1822bada9f5484e90 Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 16 Feb 2022 16:25:10 +0300 Subject: [PATCH] init: openwrt do not apply rules if WAN interface is unknown (yet) --- init.d/openwrt/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.d/openwrt/functions b/init.d/openwrt/functions index df61013..92addff 100644 --- a/init.d/openwrt/functions +++ b/init.d/openwrt/functions @@ -95,7 +95,7 @@ fw_nfqws_post_x() network_find_wan${4}_all ifaces call_for_multiple_items network_get_device DWAN "$ifaces" - _fw_nfqws_post${4} $1 "$2" $3 "$(unique $DWAN)" + [ -n "$DWAN" ] && _fw_nfqws_post${4} $1 "$2" $3 "$(unique $DWAN)" } fw_nfqws_post4() { @@ -119,7 +119,7 @@ fw_tpws_x() network_find_wan${4}_all ifaces call_for_multiple_items network_get_device DWAN "$ifaces" - _fw_tpws${4} $1 "$2" $3 "$DLAN" "$(unique $DWAN)" + [ -n "$DWAN" ] && _fw_tpws${4} $1 "$2" $3 "$DLAN" "$(unique $DWAN)" } fw_tpws4() {