Handle for things to do when network becomes available - Debian

This is a discussion on Handle for things to do when network becomes available - Debian ; Hi, What is the right location to do things that should be done when an Internet connection becomes available? By that, I mean things like running ntpdate, flushing the mail queue, maybe do some synchronization, etc. I was considering an ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Handle for things to do when network becomes available

  1. Handle for things to do when network becomes available

    Hi,

    What is the right location to do things that should be done when an
    Internet connection becomes available? By that, I mean things like
    running ntpdate, flushing the mail queue, maybe do some synchronization,
    etc. I was considering an 'up do-stuff || true' statement
    in /etc/network/interfaces, but I don't really like that approach
    because it requires me to have the same lines for several interfaces
    (the network may be ethernet, or wireless, or...).

    My best guess is something that is called anytime a route gets set up,
    but I wouldn't know how to do that. Any ideas?

    Koen


    --
    To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  2. RE: Handle for things to do when network becomes available



    >From: Koen Vermeer


    >
    >What is the right location to do things that should be done when an
    >Internet connection becomes available? By that, I mean things like
    >running ntpdate, flushing the mail queue, maybe do some synchronization,
    >etc. I was considering an 'up do-stuff || true' statement
    >in /etc/network/interfaces, but I don't really like that approach
    >because it requires me to have the same lines for several interfaces
    >(the network may be ethernet, or wireless, or...).
    >
    >My best guess is something that is called anytime a route gets set up,
    >but I wouldn't know how to do that. Any ideas?
    >
    >Koen


    I am currently trying to do something similar with scripts using ethtool
    and iwlist to determine which interface is being used and how, then calling
    ifup with the option of using a different interfaces file (I think it's -F
    filename).

    Is this the kind of thing you are after?

    John


    --
    To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  3. RE: Handle for things to do when network becomes available

    On Sun, 2005-12-11 at 16:30 +0100, johnohagan@iprimus.com.au wrote:
    > I am currently trying to do something similar with scripts using ethtool
    > and iwlist to determine which interface is being used and how, then calling
    > ifup with the option of using a different interfaces file (I think it's -F
    > filename).
    > Is this the kind of thing you are after?


    If I understand you correctly: No, not really.

    What I'm looking for is a place to put a script that is called whenever
    any working internet connection becomes available, whether it is by LAN,
    WAN, dial-up, or anything else. I can do this on a per-interface basis
    by putting 'up /path/script' lines in /etc/network/interfaces, but I am
    looking for a place that is interface-independent. In my script, I do
    not need to know the name of the interface that provides the internet
    connection, but of course it wouldn't hurt to have this information
    either.

    Koen


    --
    To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  4. Re: Handle for things to do when network becomes available

    On Mon, 2005-12-12 at 12:42 +0100, Milan Sova wrote:
    > /etc/network/if-(pre-up|up|down|post-down).d/ ?


    That's the one! Looks very nice. And in fact, there is already a handle
    for flushing the postfix mailqueue there, so I don't have to worry about
    that. I'll just add a script for ntpdate, and be happy!

    Now, where did you find this in the documentation? The man page of
    interfaces, ifup and ifdown do not mention this.

    Thanks again!
    Koen


    --
    To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  5. Re: Handle for things to do when network becomes available

    On Mon, 2005-12-12 at 13:06 +0100, Koen Vermeer wrote:
    > Now, where did you find this in the documentation? The man page of
    > interfaces, ifup and ifdown do not mention this.


    Sorry for that. The interfaces man page actually says:

    There exists for each of the above mentioned options a
    directory /etc/network/if-

+ Reply to Thread