#!/bin/bash
#-------------------------------------------------------------------------------
# get-dls-ip.sh                                  (C) 2004 T.Birnthaler OSTC GmbH
#-------------------------------------------------------------------------------
# IP-Adresse aus einer Zeile einer HTML-Seite extrahieren und anzeigen.
# Format der HTML-Seite:
#   20030913 14:42:34 212.114.236.193 SITE_A
#   1        2        3               4
#-------------------------------------------------------------------------------
USER="hans"
PASS="geheim"
 URL="http://www.test.org/dsl-ip.txt"
SITE="sunnie"

IP=$(wget --http-user="$USER" \
	      --http-passwd="$PASS" \
	      -O \
	      - "$URL" 2> /dev/null |
	grep "$SITE" |
	cut -d " " -f3,3)

echo $IP
