mmcli --modem="${device}" --simple-disconnect ||
proto_notify_error "${interface}" DISCONNECT_FAILED
- # disable
- mmcli --modem="${device}" --disable
+ # reading variable from var state which was set in
+ # '/usr/lib/ModemManager/connection.d/10-report-down'
+ # because of a reconnect event.
+ # The modem therefore does not need to be disabled.
+ local disable="$(uci_get_state network "$interface" disable_modem "1")"
+ if [ "${disable}" -eq 0 ]; then
+ echo "Skipping modem disable"
+ uci_revert_state network "${interface}" disable_modem
+ else
+ mmcli --modem="${device}" --disable
+ fi
# low power, only if requested
[ "${lowpower:-0}" -lt 1 ] ||
[ "${IFUP}" = "true" ] && {
mm_log "info" "Reconnecting '${CFG}' on '${STATE}' event"
+ uci_toggle_state network "${CFG}" disable_modem "0"
ubus call network.interface down "{ 'interface': '${CFG}'}"
ubus call network.interface up "{ 'interface': '${CFG}'}"
}