You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
866 B

  1. #!/bin/sh
  2. # Copyright (C) 2016 Velocloud Inc
  3. # Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es>
  4. # Load common utilities
  5. . /etc/modemmanager/modemmanager.common
  6. # We require a interface name
  7. [ -n "${INTERFACE}" ] || exit
  8. # Always make sure the rundir exists
  9. mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
  10. # Report network interface
  11. mm_log "${ACTION} network interface ${INTERFACE}: event processed"
  12. mm_report_event "${ACTION}" "${INTERFACE}" "net" "/sys${DEVPATH}"
  13. # Look for an associated cdc-wdm interface
  14. cdcwdm=""
  15. case "${ACTION}" in
  16. "add") cdcwdm=$(mm_track_cdcwdm "${INTERFACE}") ;;
  17. "remove") cdcwdm=$(mm_untrack_cdcwdm "${INTERFACE}") ;;
  18. esac
  19. # Report cdc-wdm device, if any
  20. [ -n "${cdcwdm}" ] && {
  21. mm_log "${ACTION} cdc interface ${cdcwdm}: custom event processed"
  22. mm_report_event "${ACTION}" "${cdcwdm}" "usbmisc" "/sys${DEVPATH}"
  23. }