Re: Need to monitor when IP Address changes

From: .:MadTux:. (madtux_at_gmail.com)
Date: 01/15/05

  • Next message: Street Chaman: "Hardware Programming"
    Date: Sat, 15 Jan 2005 17:31:03 -0500
    To: freebsd-newbies@freebsd.org
    
    

    A trick that I use if a little script that sends the output of
    ifconfig to a text file and uploads it to a password-protected web
    address via FTP. When I need to see what my IP is, I just log into my
    protected page and view the current IP.

    I have a cron job scheduled every hour to run the script, and since
    it's a tiny file, it's not a major thing to haev run every hour.

    Here's the contents of the script (which runs on 4.7 thru 4.10):

    /sbin/ifconfig fxp0 | ncftpput -c -u username -p password domain
    /path/to/file/location/my_ip

    Example with fields filled in:

    /sbin/ifconfig fxp0 | ncftpput -c -u madtux -p secretpassword
    google.com /home/google/www/protected_directory/my_ip

    ..where "my_ip" is both the output of the command and the filename.

    To actually view the file, point yer trusty browser to
    http://www.mydomain/protected_directory/my_ip

    and provide the secret answer, after which you'll see the output of ifconfig.

    I had written something a little cleaner that pulls the IP from the
    stdout and writes it to a temp file, which is then uploaded, but I
    can't find it now :P

    Anyway, hope that helps.

    -Kevin

    -- 
    A PC without Windows is like a cup of coffee without ketchup.
    _______________________________________________
    freebsd-newbies@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-newbies
    To unsubscribe, send any mail to "freebsd-newbies-unsubscribe@freebsd.org"
    

  • Next message: Street Chaman: "Hardware Programming"

    Relevant Pages

    • Re: CFT: major wireless changes
      ... known configurations ... It doesn't use the "scan" caapabilities of ifconfig, ... I started checking what the script ... ifconfig dumped core; not sure why, ...
      (freebsd-current)
    • Re: receipt database mysql
      ... | I have searched all the web for a php script to store and view receipts. ... SELECT FileName ... INSERT INTO upLoads ... var skipValidation = false; ...
      (alt.php)
    • Re: [opensuse] ipconfrig--where?
      ... Do not script around ifconfig. ... e.g. there is still a large amount of old Cobol out there still being ... Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ ...
      (SuSE)
    • Re: ifconfig doesnt detect change under crontab
      ... > Whenever my IP address changes, the cron'd ifconfig doesn't seem to ... If using dhcp instead, then something related to whatever does your ... dhcp should have related scripts that can also monitor ... So it appears that something in your undisclosed crontab entry or script ...
      (comp.os.linux.networking)
    • Re: CFT: major wireless changes
      ... ifconfig dumped core; not sure why, ... need to tweak in my script. ... bmiss 7 scanvalid 60 bintval 100 ... DHCPREQUEST on ed1 to 255.255.255.255 port 67 ...
      (freebsd-current)