Internet Datacard gets disconnected after sometime

Hi all,

If i leave my laptop idle for sometime, my usb datacard connection gets disconnected. I know its a dial-up connection and if no application is accessing internet it disconnects on its own.

The problem over here is when i click on the icon and click on activate it won’t happen. So, i have to unplug the hardware and then re-insert it to make it work again.

I went through a site, there they have mentioned a work around that is to keep a ping command always running.

I’m fine with that, but why do we need to remove the hardware n re-insert it to make it connect to the internet again.

I hope there must be some better work around…

Thanks in advance… .:slight_smile:

I wrote a keep alive bash script I called gping you could run in a terminal session to keep your session running. It does an (adjustable) ping every 5 minutes to an (optional) Google and would exit if it failed to ping the site. Copy and past this text into a text editor:


#: Title       : gping
#: Date Created: Sat May 21 08:59:04 CDT 2011
#: Last Edit   : Sat May 21 08:59:04 CDT 2011
#: Author      : J. McDaniel
#: Version     : 1.00
#: Description : Ping a Site on a specified Interval
#: Options     : None

# What Do you want to Ping?

# How Many Times to Ping Site

# How Long To Wait in seconds Between Pings

while true  ; do
  ping -c $(( Num_Pings )) $Ping_What
  if  $(( Exit_Code )) -ge 1 ] ; then
    echo "Could Not Ping: $Ping_What" 
    exit $(( Exit_Code ))
   sleep $(( Wait_Time ))

exit 0
# End Of Script

Save the text into the folder ~/bin (/home/yourname/bin) as the text file gping. Then run the following command on it to make it executable:

chmod +x ~/bin/gping

To use gping, just open up a terminal session and run the command:


Every five minutes, you would see something like this in your terminal session:

PING ( 56(84) bytes of data.
64 bytes from icmp_req=1 ttl=53 time=15.2 ms
64 bytes from icmp_req=2 ttl=53 time=14.0 ms
64 bytes from icmp_req=3 ttl=53 time=27.2 ms

--- ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 14.064/18.881/27.291/5.967 ms

Hope you find this helpful…

Thank You,

Thanks James it does help… thanks a ton… well i like the last line :wink:

**Remember that little in Life is certain, including any advice you may get from me, you poor soul, but at least I am trying to help.

Its James again from Austin Texas - To err is human… to really foul up requires the root password!**

Thanks James it does help… thanks a ton… well i like the last line :wink:
You are very welcome lavi0007 for the help. Please let us know if you require any other assistance and thanks for using openSUSE and the openSUSE forum.

Thank You,