netifd: return error status in reload_service
authorHans Dedecker <dedeckeh@gmail.com>
Fri, 21 Apr 2017 09:44:57 +0000 (11:44 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 13 Dec 2017 14:17:54 +0000 (15:17 +0100)
Based on a patch by Alexandru Ardelean.
netifd ubus reload call returns the actual reload error status;
return error status as well in reload_service

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 4b195a611fe146969e813ce77ecf74ce5f9c176b)

package/network/config/netifd/files/etc/init.d/network

index a825dfd31fbc805feae2ede556ddef7f728dfb72..6cd167d19d221dead5e0dc28a518c21c8c120dbb 100755 (executable)
@@ -26,9 +26,12 @@ start_service() {
 }
 
 reload_service() {
+       local rv=0
+
        init_switch
-       ubus call network reload
+       ubus call network reload || rv=1
        /sbin/wifi reload_legacy
+       return $rv
 }
 
 stop_service() {