comgt: fix hotplug event handling
authorRozhuk Ivan <rozhuk.im@gmail.com>
Sat, 16 Nov 2019 02:10:05 +0000 (05:10 +0300)
committerJo-Philipp Wich <jo@mein.io>
Sat, 19 Sep 2020 17:48:27 +0000 (19:48 +0200)
Hotplug manager send: "remove" -> "add" -> "bind" events,
script interpret bind as "not add" = "remove" and mark device
as unavailable.

Signed-off-by: Rozhuk Ivan <rozhuk.im@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
(cherry picked from commit 4821ff064b735c320ae2625a739018d1fc7d6457)
Fixes: FS#3351
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
package/network/utils/comgt/Makefile
package/network/utils/comgt/files/3g.usb

index 64296c9852e492aeeee8c1bf6d6de5d39bfc811f..db5ea5747357069acc131c1a2bf75a44f2e9adfd 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=comgt
 PKG_VERSION:=0.32
-PKG_RELEASE:=32
+PKG_RELEASE:=33
 
 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=@SF/comgt
index ac8326b710cfd51170acd7602e7418cf8269d682..8f0d62ca83a54c7c71369a0e4793d1c509adda1e 100644 (file)
@@ -15,11 +15,11 @@ find_3g_iface() {
 
        if [ "${dev##*/}" = "${tty##*/}" ]; then
                if [ "$ACTION" = add ]; then
-                       available=1
-               else
-                       available=0
+                       proto_set_available "$cfg" 1
+               fi
+               if [ "$ACTION" = remove ]; then
+                       proto_set_available "$cfg" 0
                fi
-               proto_set_available "$cfg" $available
        fi
 }