Results 1 to 6 of 6

Thread: Bash script for internet connection in Ubuntu

  1. #1
    Join Date
    Dec 2009
    Posts
    80

    Bash script for internet connection in Ubuntu

    I am using a huawei e169g internet key for connecting to the internet on my home PC which is installed with windows 7. Now i want to use this internet key for connecting to the internet but on my Office PC which is installed with Ubuntu Operating system. I have a bash script with which i can connect to the internet but it is not working. Hence I am desperately in need of a Bash script for connecting to the internet.
    Last edited by Callium; 23-01-2010 at 05:10 PM.

  2. #2
    Join Date
    Apr 2008
    Posts
    3,295

    Re: Bash script for internet connection in Ubuntu

    You have niot specified whether you are going to connect to the internet manually. Please specify that you just require turning on the network interface Or is something more involved in order to get the connection working. Also you have not specified that you are using the networkmanager or not. please furnish all these details in your further replies.

  3. #3
    Join Date
    Nov 2005
    Posts
    3,026

    Re: Bash script for internet connection in Ubuntu

    I think that you can try to achieve this by sudo ifup wlan . Check whether it works from the terminal. In the command above replace the wlan with the name of your network device. You can also verify all the network devices using the "ifconfig" command. Using this command you can definitely get connected to the internet.

  4. #4
    Join Date
    Dec 2009
    Posts
    80

    Re: Bash script for internet connection in Ubuntu

    Thanks for replying me. It seems as none of your solution worked for me so i triwed the comands but that could not help me to solve this issue also i am not able to connect to the internet using the network manager too. please suggest some other solutions in this matter also if possible try to provide a bash script which would help me to check the Internet connection availability.

  5. #5
    Join Date
    Nov 2005
    Posts
    1,203

    Re: Bash script for internet connection in Ubuntu

    For connecting to the internet with the help of an internet key you will have to use the code which i have mentioned below:

    sudo /etc/init.d/networking restart

    Use this code and get connected to the internet using your huawei internet key. Hopefully this will fix your issue soon if this does not help you try using the networkmanager
    Last edited by Humberto; 23-01-2010 at 05:36 PM.

  6. #6
    Join Date
    May 2008
    Posts
    4,085

    Re: Bash script for internet connection in Ubuntu

    As you have asked for a bash script which will help you to check whether your internet connection is working or not i have posted the script for that purpose below

    #!/bin/bash

    WGET="/usr/bin/wget"

    $WGET -q --tries=10 --timeout=10 http://www.google.com -O /tmp/index.google &> /dev/null
    if [ ! -s /tmp/index.google ];then
    echo "no"
    else
    echo "yes"
    fi

    this script will return "yes " if the google pagge is downloaded else it will return ''no'' . Also if it fails to open a page within 10 seconds it will again return a "no"

Similar Threads

  1. How to create CGI script in bash?
    By Mulan in forum Software Development
    Replies: 5
    Last Post: 01-09-2010, 08:19 PM
  2. Linux bash script for telnet connection
    By Rubero in forum Software Development
    Replies: 5
    Last Post: 23-08-2010, 09:08 PM
  3. Linux bash script with the command w
    By Trini Alvarado in forum Operating Systems
    Replies: 4
    Last Post: 22-03-2010, 12:11 PM
  4. Create bash script for ftp
    By teenQ in forum Operating Systems
    Replies: 4
    Last Post: 04-03-2010, 07:37 PM
  5. Bash script if then else help
    By Unix'EM in forum Software Development
    Replies: 3
    Last Post: 18-08-2009, 06:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,912,571.63477 seconds with 16 queries