From 602b929c981940c830b7e9ab3137d6a254525c06 Mon Sep 17 00:00:00 2001 From: hanwckf Date: Mon, 16 Oct 2023 01:47:17 +0800 Subject: [PATCH] netifd: auto detect mtk wifi-profile scripts --- .../config/netifd/files/etc/init.d/network | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network index b29b4da98d..3dbd0cb3ee 100755 --- a/package/network/config/netifd/files/etc/init.d/network +++ b/package/network/config/netifd/files/etc/init.d/network @@ -30,7 +30,11 @@ reload_service() { init_switch ubus call network reload || rv=1 - /sbin/wifi up + if [ -f "/lib/wifi/mtwifi.lua" ]; then + /sbin/wifi up + else + /sbin/wifi reload_legacy + fi return $rv } @@ -40,12 +44,11 @@ stop_service() { sleep 1 } - - - service_running() { + if [ -f "/lib/wifi/mtwifi.lua" ]; then ubus -t 120 wait_for network.interface.lan /sbin/wifi reload_legacy + fi } validate_atm_bridge_section() @@ -147,8 +150,8 @@ service_triggers() } shutdown() { - /sbin/wifi down - ifdown -a - sleep 1 + /sbin/wifi down + ifdown -a + sleep 1 }