CFG=$(mm_get_modem_config "${MODEM_DEVICE}")
[ -n "${CFG}" ] || exit 3
-logger -t "modemmanager" "interface ${CFG} (network device ${INTERFACE}) ${STATE}"
-proto_init_update $INTERFACE 0
-proto_send_update $CFG
+IFUP=$(ifstatus "${CFG}" | jsonfilter -e "@.up")
+
+[ "${IFUP}" = "true" ] && {
+ logger -t "modemmanager" "interface ${CFG} (network device ${INTERFACE}) ${STATE}"
+ proto_init_update $INTERFACE 0
+ proto_send_update $CFG
+}
+
exit 0
proto_send_update "${interface}"
}
-modemmanager_disconnected_method_common() {
- local interface="$1"
-
- echo "running disconnection (common)"
-
- proto_init_update "*" 0
- proto_send_update "${interface}"
-}
-
proto_modemmanager_init_config() {
available=1
no_device=1
# disconnection handling only requires special treatment in IPv4/PPP
[ "${bearermethod_ipv4}" = "ppp" ] && modemmanager_disconnected_method_ppp_ipv4 "${interface}"
- modemmanager_disconnected_method_common "${interface}"
# disconnect
mmcli --modem="${device}" --simple-disconnect ||
# low power, only if requested
[ "${lowpower:-0}" -lt 1 ] ||
mmcli --modem="${device}" --set-power-state-low
-
- proto_init_update "*" 0
- proto_send_update "$interface"
}
[ -n "$INCLUDE_ONLY" ] || {