#!/bin/sh

#
# Dynamic DNS example
# Copyright 1999-2003 DVL Software Limited
#
# Available from http://www.freebsddiary.org/samples/dns_fetch.sh
#

#HTTP_AUTH="basic:*"

export HTTP_AUTH="basic:*:userid:password"

#                                                                   
# this isn't needed.  It doesn't do much good anyway.  but was in the
# original yi.org script                                            
#                                                                   
                                                                    
#ip_addr=`netstat -rn | egrep ^0.0.0.0 | sed -e "s,.* ,,g" | \      
#       xargs /sbin/ifconfig | grep "inet.addr" | sed -e "s,.*addr:,," \
#       -e "s, .*,,"`                                               
                                                                    
#                                                                   
# get the incoming parameter from our perl script from where we were launched
#                                                                   
ip_addr=$1                                                          
                               
now=`date`

fetch  -q -o /usr/home/dan/fetch_results.html\
        http://www.yi.org/bin/dyndns.fcgi?ipaddr=$ip_addr | \
        sed -e "s,^,$now: ," -e "s,<.*\?>,,g"
