#!/bin/bash
#
# myip - getting the ip-addresses from this computer...
#
# Copyright (C) 2004 Ilja Gerhardt <ilja@so36.de>
#
# This source code is free software; you can redistribute it and/or
# modify it under the terms of the GNU Public License as published 
# by the Free Software Foundation; either version 2 of the License,
# or (at your option) any later version.
#
# This source code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Please refer to the GNU Public License for more details.
#
# You should have received a copy of the GNU Public License along with
# this source code; if not, write to:
# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

: ${DIALOG=dialog}
myip=`/sbin/ifconfig | grep inet | awk {'print $2;'} | sed s/.*://`

[ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
# LANGUAGE="`getbootparam lang`"

case "$LANGUAGE" in
de|at|ch)
BT=" MyIP "
TI=" Meine IP-Adresse "
M1="Dieses kleine Programm zeigt nur die\n
IP-Adresse(n) dieses Computers an:\n
\n
$myip\n
\n
        Zum Beenden einfach OK"
;;
*)
BT=" MyIP "
TI=" My IP-Address "
M1="This little program just shows the\n
IP-address(es) of this computer:\n
\n
$myip\n
\n
        Press OK to finish"
;;
esac

###############

$DIALOG --title "$TI" --backtitle "$BT" --cr-wrap --clear --msgbox "$M1" 0 0 
