Forráskód Böngészése

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 <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/14986
Signed-off-by: Robert Marko <[email protected]>
Andris PE 2 éve
szülő
commit
207bfee855

+ 1 - 1
package/network/config/netifd/Makefile

@@ -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

+ 2 - 2
package/network/config/netifd/files/etc/init.d/network

@@ -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
 }