Re: Script to connect to internet at bootup
- From: Fajar Priyanto <fajarpri@xxxxxxxxxx>
- Date: Sat, 5 Mar 2011 09:26:59 +0800
On Sat, Mar 5, 2011 at 3:48 AM, Olivier Cailloux
<olivier.cailloux@xxxxxxxxx> wrote:
Also the script works if I set a delay of 15 seconds before running it. But
I'd like to find some clean way of configuring this, that is, I'd like to be
able to specify to run the script only when "everything needed" (meaning, I
guess: the DNS system) is ready. That's why I thought I'd use the dependency
mechanism of init.d (see above the original post), but there may exist
better approaches.
Olivier
So, you are correct. It's timing issue. Delaying the script makes it work.
Well, if you don't want to use the delay method, we can use command to
resolve something, and if it doesn't succeed, keep trying until
successful, then run the authenticate script.
Some example I found in the net:
WGET="/usr/bin/wget" $WGET -q --tries=10 --timeout=5
http://www.google.com -O /tmp/index.google &> /dev/null if [ ! -s
/tmp/index.google ];then echo "no" else echo "yes" fi
Read more: http://www.linuxscrew.com/2009/04/02/tiny-bash-scripts-check-internet-connection-availability/#ixzz1FgTn9iYo
Also, I think better write all those thing in a separate script and
call it through rc.local instead for tidiness.
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: Script to connect to internet at bootup
- From: Olivier Cailloux
- Re: Script to connect to internet at bootup
- References:
- Re: Script to connect to internet at bootup
- From: Edwards, Todd - McClatchy Interactive
- Re: Script to connect to internet at bootup
- From: Olivier Cailloux
- Re: Script to connect to internet at bootup
- From: Smoot Carl-Mitchell
- Re: Script to connect to internet at bootup
- From: Olivier Cailloux
- Re: Script to connect to internet at bootup
- Prev by Date: Re: Squid Proxy to IPv6
- Next by Date: REISUB versus ctrl-alt-del
- Previous by thread: Re: Script to connect to internet at bootup
- Next by thread: Re: Script to connect to internet at bootup
- Index(es):
Relevant Pages
|