I use my mobile (Samsung Corby GT-S3653) to connect to the internet and my mobile network gets automatically disconnected periodically when I'm using it for GPRS so I always have to click that notification icon and click "Tata Docomo Internet" for reconnecting it. Sometimes I have to repeat the process a couple of times until it properly connects. I want to know if there's a way to automate this process with the command line (or any other program) so I don't have to keep doing this all the time it disconnects.
In the case of you, I suggest to create a custom shortcut key:
go to System Settings > Keyboard > Shortcuts [tab] > Custom Shortcuts and clicking on the + button to create a new one.
Then click on it and assign your desired shortcut key. Now when it gets disconnected, you can connect simply with the shortcut key.
If you want to use more complex script you can see this question.