modemmanager_check_state "$device" "${modemstatus}" "$pincode"
[ "$?" -ne "0" ] && return 1
+ # always cleanup before attempting a new connection, just in case
+ modemmanager_cleanup_connection "${modemstatus}"
+
+ mmcli --modem="${device}" --timeout 120 --enable || {
+ proto_notify_error "${interface}" MM_MODEM_DISABLED
+ return 1
+ }
+
if [ -z "${allowedmode}" ]; then
modemmanager_set_allowed_mode "$device" "$interface" "any"
else
[ "$?" -ne "0" ] && return 1
fi
- # always cleanup before attempting a new connection, just in case
- modemmanager_cleanup_connection "${modemstatus}"
-
- mmcli --modem="${device}" --timeout 120 --enable || {
- proto_notify_error "${interface}" MM_MODEM_DISABLED
- return 1
- }
-
# set initial eps bearer settings
[ -z "${init_epsbearer}" ] || {
case "$init_epsbearer" in