[OLUG] e-mail dhcp address

Vincent vraffensberger at home.com
Sat Jan 22 23:16:40 UTC 2000


I forget who asked me about this at the meeting, but here it is for
anyone.

This script will send the ip address from the box it runs on to wherever
you need it.  Just schedule it in crontab.

--snip--cut-here--whatever--


#!/bin/sh

#
# Configurable Parameters
#
MAILTO="<your at address.org>"
INTERFACE="ppp0"

HOST=`/bin/hostname`

MYNEWIP=`/sbin/ifconfig $INTERFACE | grep addr: | \
  awk -F" " '{print $2}' | awk -F":" '{print $2}'`

echo "New dynamic IP number for $HOST is: $MYNEWIP" | \
/bin/mail -s "New IP for $HOST: $MYNEWIP" $MAILTO


--snip--cut-here--whatever--

-------------------------------------------------------------------------
Sent by OLUG Mailing list Manager, run by ezmlm.  http://olug.bstc.net/ 
To unsubscribe: `echo unsubsribe | mail olug-unsubscribe at bstc.net` 



More information about the OLUG mailing list