I use ZTE USB Modem on Natty Narwhal. Every thing works fine but sometimes it get disconnected. I want to write Shell script that reconnects mobile broadband if it is disconnected or the received data is less than 20 KB after 5 seconds of connection.
So my question is how to enable/disable mobile broadband? How to check for data received? and how to enable/disable network service ?
note: terminal commands only Or if you can write script, I'll be very thankful.
Open terminal window and type:
Then copy and paste this (Change for your needs):
Note: Replace the
<Your Mobile Broadband Connection Name Here>
with the name of your connection.Change the permissions of this file for execution:
To run this script has a service, do:
The script is registered as a system startup service so you can start, stop, or check the status of the script with :
Reboot to complete installation and auto connect.
Done ...
I created a shell script as follows and put that in
Startup Applications
and it works like a charm ! I am happy with this but if you can make it better I'll be very thankful.