Re: Homemade laptop lojack: ping website early in boot process
- From: James Gray <james@xxxxxxxxxxx>
- Date: Mon, 7 Jul 2008 07:29:17 +1000
On 07/07/2008, at 7:16 AM, James Gray wrote:
On 07/07/2008, at 5:08 AM, Dotan Cohen wrote:
I'd like to have my laptop try to ping a website that I control as
early in the boot process as possible, preferably as soon as the wifi
is enabled. How is this done? Thanks.
How about, as soon as the interface is up...soon enough? ;)
man interfaces
...
IFACE OPTIONS
...
post-up _command_
Run command after bringing the interface up. If this
command fails then ifup aborts, refraining from marking
the interface as configured (even though it has really
been configured), prints an error message, and exits
with status 0. This behavior may change in the future.
The easiest way to avoid the potential "if the command fails"...you
simply wrap the whole ping up in a script that returns zero and
execute that script as the post-up command. In pure Debian land,
there is a directory "/etc/network/if-post-up.d" which will execute
all the scripts in it when an interface comes up (not sure if Ubuntu
support this method though as the directory doesn't exist on my
systems).
Poor form replying to my own post...but if I'd been smarter I'd have
read the rest of the text on the man page:
"There exists for each of the above mentioned options a directory /etc/
network/if-<option>.d/ the scripts in which are run (with no
arguments) using run-parts(8) after the option itself has been
processed."
So Ubuntu *does* support the Debian-style up/down pre/post directory
structures. There are also a raft of environment variables passed to
the commands in both the "interfaces" file and /etc/network/if-
<option>.d/ scripts which may prove to be useful.
Cheers,
James
PS. I shall now go and slap myself around with a large, wet, trout
while chanting the mantra "RTFM, RTFM"
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: Homemade laptop lojack: ping website early in boot process
- From: Dotan Cohen
- Re: Homemade laptop lojack: ping website early in boot process
- From: Chris Mohler
- Re: Homemade laptop lojack: ping website early in boot process
- References:
- Homemade laptop lojack: ping website early in boot process
- From: Dotan Cohen
- Re: Homemade laptop lojack: ping website early in boot process
- From: James Gray
- Homemade laptop lojack: ping website early in boot process
- Prev by Date: Re: Looking for a Picture Management Program#
- Next by Date: Re: Hardy startup progress bar missing after installing Intrepid Ibex
- Previous by thread: Re: Homemade laptop lojack: ping website early in boot process
- Next by thread: Re: Homemade laptop lojack: ping website early in boot process
- Index(es):
Relevant Pages
|