Re: How-to auto-start programmes when I connect to Internet?

From: Christopher K. Johnson (ckjohnson_at_gwi.net)
Date: 02/14/04

  • Next message: M.Hockings: "OT: Warning Regarding Microsoft"
    To: fedora-list@redhat.com
    Date: Sat, 14 Feb 2004 10:30:11 -0500
    
    

    Hal Burgiss wrote:

    >On Fri, Feb 13, 2004 at 02:01:04PM +0000, Coume - Lubox.com wrote:
    >
    >
    >>>Sure, write a script that checks for connection, and restarts whatever
    >>>you want it to.
    >>>
    >>>
    >>Could you explain a bit more? Because I do not know how to do what
    >>you told me... :(
    >>
    >>
    Guys - I think you are missing an easier solution.
    Correct me if I am wrong, but I think the problem you are solving is this:
    There is an ethernet connection to an ISP, and all you want to do is run
    a script to restart services whenever that interface is brought up.

    If that is the case just make a script /sbin/ifup-local that checks
    whether the sole argument is the interface you care about, and if so,
    performs the restarts.

    Actually I like to put the ifup-local script in
    /etc/sysconfig/network-scripts and add a symbolic link to it from
    /sbin/ifup-local. That way I can keep my script in the same location as
    the interface configurations.

    Here is a sample script I used to set system time whenever an on-demand
    ppp0 interface was started:
    ---------------------------------------------------------------
    #!/bin/bash
    #Invoked from ifup-post via /sbin/ifup-local ${DEVICE}
    #The installer must add a symbolic link from /sbin/ifup-local to this script
    if [ $1 = "ppp0" ] ; then
      ntpdate=`ntpdate tock.usno.navy.mil 2>&1`
      ntprc=$?
      logger "ifup-local: $ntpdate"
      if [ $ntprc -eq 0 ] ; then
        clock -w
        logger "ifup-local: clock -w performed"
      fi
    fi
    ---------------------------------------------------------------

    -- 
    -----------------------------------------------------------
       "Spend less!  Do more!  Go Open Source..." -- Dirigo.net
       Chris Johnson, RHCE #807000448202021
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: M.Hockings: "OT: Warning Regarding Microsoft"

    Relevant Pages

    • Re: BASH script to list previous IP Addresses
      ... | Here's the part of my script I have so far... ... PPP connection by my ISP, but have been reluctant to code the usually ... ~ - the name of the logical interface over which the connection has been ...
      (alt.os.linux)
    • Re: C and other programming languages
      ... usually wrapping a C function requires manual effort, ... How is it done in you language ... the interface froim Tcl/Tk to C is somehow better, ... the script language. ...
      (comp.lang.misc)
    • Re: Easiest/quickest method for very simple interfaces?
      ... T would be backwards-combatible with the Horse Interface they were used ... >> line and invoke that script. ... The First Rule of Program Optimization: ... The Second Rule of Program Optimization: ...
      (comp.os.linux.misc)
    • Re: Cant Get Open/SaveAs Dialogs
      ... manipulate Open and Save/As file dialog windows. ... execution in the MS Script Debugger halts at that line. ... now reports the error "The control cannot be created because it is ... its user interface. ...
      (microsoft.public.scripting.jscript)
    • Re: How can I add trusted groups to DL-groups with dsmod or other
      ... LDAP interface, there is NO DN that points to anything in the NT domains. ... > I am not a script specialist, normaly I use cmd-scripts with command> line tools like dsmod but I think my problem needs a special script> solution. ...
      (microsoft.public.windows.server.active_directory)