netifd: check if /sbin/wifi exists before calling it
authorAndris PE <neandris@gmail.com>
Tue, 26 Mar 2024 19:53:06 +0000 (21:53 +0200)
committerRobert Marko <robimarko@gmail.com>
Sat, 30 Nov 2024 18:23:29 +0000 (19:23 +0100)
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>
package/network/config/netifd/Makefile
package/network/config/netifd/files/etc/init.d/network

index 82a04adecd932054c15b7fee53693053bb552609..95f1f6f7d11e09928874753ae10355ec84ef448f 100644 (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
index dc208c4ce0a1f5982d732860111421257540bfd2..86340b77e53c6eada22ded2193cbbe406bd8a40b 100755 (executable)
@@ -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
 }