nmcli is a command-line tool for controlling NetworkManager and getting its status.
I also had same problem while using Mobile Broadband.
I have created a shell script as follows. Save it, give execution permission and Put that in Startup Applications and it works like a charm ! It will connect automatically if connection is dropped. That is what I wanted.
You need to change network id (for me it is
"Tata Docomo Internet"). Replace
"Tata Docomo Internet" with name of your Mobile Broadband connection name.
while true; do
LC_ALL=C nmcli -t -f TYPE,STATE dev | grep -q "^gsm:disconnected$"
if [ $? -eq 0 ]; then
#jdownloader is still in the download status so stop it because
#internet is disconnected and jdownloader won't resume download
#when connected again
#sometimes I can not get connected after disconnection when
#I click on <name of the network connection>. I have to disable
#and enable Mobile Broadband
nmcli -t nm wwan off
nmcli -t nm wwan on
nmcli -t con up id "Tata Docomo Internet"
#wait approximately 15 sec to get connected
#if anyone can add better command to check for it just comment it :-p
#now connected to internet so start download
#it does not worth keep it checking every millisecond.
#my connection will be reestablished within 5-15 seconds
#if anyone can code it better please feel free to comment
#TO-DO:: check for data received. if data < 15 KB after 20 seconds of connection
#reconnect mobile broadband connection