Re: socket.AF_INET

2008-04-20 Thread Juergen Perlinger
Matt Herzog wrote: > Hi All. > > I'm trying to write a script that will send me an email message when my IP > address changes on a specific NIC. On Linux, the script works. On FreeBSD, > it fails with: > > [snip] > > def get_ip_address(ifname): >

socket.AF_INET

2008-04-19 Thread Matt Herzog
mail" IPADDY = "85.126.250.328" #IFCONFIG = "/sbin/ifconfig import os import smtplib import socket import fcntl import struct def get_ip_address(ifname): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) return socket.inet_ntoa(fcntl.ioctl( s.fileno(), 0