Script to connect to internet at bootup

Fajar Priyanto fajarpri at arinet.org
Sat Mar 5 17:45:57 UTC 2011


On Sat, Mar 5, 2011 at 11:53 PM, Olivier Cailloux
<olivier.cailloux at gmail.com> wrote:

> So one way to go would be to further explore that suggestion by testing in
> some loop, or with some other tools, whether the DNS resolves (some hints
> are given on the page you suggested). Or simply run my curl command
> repeatedly in a loop until it works (with a limit on the number of tries).
> I'll do this if I don't get any better suggestion on this list.
>
> However my one-line script is becoming more and more complex, it feels
> strange to me to have to manually implement a check in a loop just to
> specify a dependency on the DNS service. I still wonder if I could use
> something like the dependency mechanism init.d uses (AFAIU), or anything of
> the same kind.

Well, IMHO, in this case there are only two choices:
1. Since you know roughly how long it takes for the internet
connection to be established, say.. 20 seconds from booting, then the
delay method is the most efficient way to accomplish what you want.
2. But if you don't want the first method, the only way is to tell the
OS to check the internet connection in a loop then authenticate, or do
the authentication in a loop. You can incorporate this with beep sound
if you want. Just to inform you nicely when the authentication is
successful.
https://launchpad.net/ubuntu/+source/beep




More information about the ubuntu-users mailing list