1
0

wwan.usb 461 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. [ "$ACTION" = add -a "$DEVTYPE" = usb_device ] || exit 0
  3. . /lib/functions.sh
  4. . /lib/netifd/netifd-proto.sh
  5. vid=$(cat /sys$DEVPATH/idVendor)
  6. pid=$(cat /sys$DEVPATH/idProduct)
  7. [ -f "/lib/network/wwan/$vid:$pid" ] || exit 0
  8. find_wwan_iface() {
  9. local cfg="$1"
  10. local proto
  11. config_get proto "$cfg" proto
  12. [ "$proto" = wwan ] || return 0
  13. proto_set_available "$cfg" 1
  14. ifup $cfg
  15. exit 0
  16. }
  17. config_load network
  18. config_foreach find_wwan_iface interface