2
0

wwan.usbmisc 643 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. [ "$ACTION" = add ] || [ "$ACTION" = remove ] || exit 0
  3. [ "${DEVNAME/[0-9]/}" = cdc-wdm ] || exit 0
  4. . /lib/functions.sh
  5. . /lib/netifd/netifd-proto.sh
  6. find_wwan_iface() {
  7. local cfg="$1"
  8. local proto device
  9. config_get proto "$cfg" proto
  10. config_get device "$cfg" device
  11. [ "$proto" = wwan ] || [ "$proto" = mbim ] || [ "$proto" = qmi ] || [ "$proto" = ncm ] || return 0
  12. [ -z "$device" -a "$proto" = wwan ] || [ "$device" = "/dev/$DEVNAME" ] || return 0
  13. if [ "$ACTION" = add ]; then
  14. proto_set_available "$cfg" 1
  15. else
  16. proto_set_available "$cfg" 0
  17. fi
  18. exit 0
  19. }
  20. config_load network
  21. config_foreach find_wwan_iface interface