umbim: auto retry when bringup fails
[openwrt/svn-archive/archive.git] / package / network / utils / umbim / files / lib / netifd / proto / mbim.sh
index 461e5fa20c97f8033eeebbb5c68378bb7facb11d..db0c7b0c3c784f152008f6008f51db9e3fec1100 100755 (executable)
@@ -19,7 +19,7 @@ proto_mbim_init_config() {
        proto_config_add_string password
 }
 
-proto_mbim_setup() {
+_proto_mbim_setup() {
        local interface="$1"
        local tid=2
        local ret
@@ -140,6 +140,20 @@ proto_mbim_setup() {
        ubus call network add_dynamic "$(json_dump)"
 }
 
+proto_mbim_setup() {
+       local ret
+
+       _proto_mbim_setup $@
+       ret=$?
+
+       [ "$ret" = 0 ] || {
+               logger "mbim bringup failed, retry in 15s"
+               sleep 15
+       }
+
+       return $rt
+}
+
 proto_mbim_teardown() {
        local interface="$1"