Re: How to tell IP address of remote machine?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2009-10-25 at 12:27 +0000, Timothy Murphy wrote:
> I had a little program which I ran each day
> as a cron job to mail me the IP address of a machine
> in a different country.
> I give the program sm.py below;
> I can't remember where I found it.
> 
> In any case, the program has ceased to work
> because the site heliohost seems to have gone off-line.
> 
> I wonder if anyone knows of an alternative site
> which I could substitute?
> Or an alternative program?
> 
> -------------------------------------
> SENDMAIL = "/usr/sbin/sendmail"
> import os
> import socket
> import urllib2
> import sys
> import time
> tt = time.ctime()
> response = urllib2.urlopen("http://darkstar.heliohost.org/ip.php";)
> ipaddr = response.readline().split('<')[0]
> f = open("mylog.txt", "w")
> f.write(ipaddr + " " + "on" + " " + tt + "\n" )
> f.close()
> p = os.popen("%s -t -fgayleard@xxxxxxxx" % SENDMAIL, "w")
> p.write("To: gayleard@xxxxxxxxxx\r\n")
> p.write("From: Timothy Murphy <gayleard@xxxxxxxxxx>\r\n")
> p.write("Subject: Anghiari IP address\r\n")
> p.write("\r\n")
> p.write(ipaddr + "\r\n")
> p.close()
> sys.exit()
> -------------------------------------
> [tim@althea ~]$ sudo cat /etc/cron.daily/ip-address
> #!/bin/sh
> 
> /usr/bin/python /home/tim/sm.py
> -------------------------------------
> 

I have been using wget to check my external IP (for conky).

wget -O - http://ip.tupeux.com | tail

Should give you the output to STDOUT...

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux