[ -n "$apn" ] || {
echo "No APN specified"
proto_notify_error "$interface" NO_APN
- proto_set_available "$interface" 0
return 1
}
[ $? -ne 0 ] && {
echo "Failed to get modem information"
proto_notify_error "$interface" GETINFO_FAILED
- proto_set_available "$interface" 0
return 1
}
eval COMMAND="$i" gcom -d "$device" -s /etc/gcom/runcommand.gcom || {
echo "Failed to initialize modem"
proto_notify_error "$interface" INITIALIZE_FAILED
- proto_set_available "$interface" 0
return 1
}
done
COMMAND="$setmode" gcom -d "$device" -s /etc/gcom/runcommand.gcom || {
echo "Failed to set operating mode"
proto_notify_error "$interface" SETMODE_FAILED
- proto_set_available "$interface" 0
return 1
}
json_select ..
eval COMMAND="$connect" gcom -d "$device" -s /etc/gcom/runcommand.gcom || {
echo "Failed to connect"
proto_notify_error "$interface" CONNECT_FAILED
- proto_set_available "$interface" 0
return 1
}