netifd: check if /sbin/wifi exists before calling it

Avoid harmless error from network script by checking presence of
now-optional wifi support script, most notably confusing users of x86
snapshots.

Fixes: #14964
Signed-off-by: Andris PE <neandris@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14986
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 207bfee855)
This commit is contained in:
Andris PE 2024-03-26 21:53:06 +02:00 committed by Hauke Mehrtens
parent 6c664135f9
commit 28de3ffefa
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netifd
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git

View File

@ -30,12 +30,12 @@ reload_service() {
init_switch
ubus call network reload || rv=1
/sbin/wifi reload_legacy
[ -x /sbin/wifi ] && /sbin/wifi reload_legacy
return $rv
}
stop_service() {
/sbin/wifi down
[ -x /sbin/wifi ] && /sbin/wifi down
ifdown -a
sleep 1
}