1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 11:01:50 +00:00
openmptcprouter-feeds/modemmanager/files/25-modemmanager-net
2023-01-13 17:53:14 +01:00

31 lines
886 B
Bash

#!/bin/sh
# Copyright (C) 2016 Velocloud Inc
# Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es>
# Load common utilities
. /usr/share/ModemManager/modemmanager.common
# We require a interface name
[ -n "${INTERFACE}" ] || exit
# Always make sure the rundir exists
mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
# Report network interface
mm_log "info" "${ACTION} network interface ${INTERFACE}: event processed"
mm_report_event "${ACTION}" "${INTERFACE}" "net" "/sys${DEVPATH}"
# Look for an associated cdc-wdm interface
cdcwdm=""
case "${ACTION}" in
"add") cdcwdm=$(mm_track_cdcwdm "${INTERFACE}") ;;
"remove") cdcwdm=$(mm_untrack_cdcwdm "${INTERFACE}") ;;
esac
# Report cdc-wdm device, if any
[ -n "${cdcwdm}" ] && {
mm_log "info" "${ACTION} cdc interface ${cdcwdm}: custom event processed"
mm_report_event "${ACTION}" "${cdcwdm}" "usbmisc" "/sys${DEVPATH}"
}