#! /bin/bash ## ## Usage: @PROG@ ## ## Display IP address using gxmessage ## PROG=$(basename $0) MSG_TITLE="IP Address" XMESSAGE=${XMESSAGE:-$(which gxmessage)} || XMESSAGE=xmessage [ "$XMESSAGE" != xmessage ] && MSG_WRAP=-wrap showUsage () { sed -n '/^##/s/^## //p' $0 | sed -e "s/@PROG@/${PROG}/g" exit 0 } [ "$1" = "-h" -o "$1" = "--help" ] && showUsage msg=$( /sbin/ifconfig ppp0 2>&1 ) && msg=$( echo "$msg" | sed -n 's/^[[:space:]]*inet addr:\([0-9.]\+\).*/\1/p' ) $XMESSAGE -center $MSG_WRAP \ -title "$MSG_TITLE" \ -buttons "GTK_STOCK_CLOSE:0" \ -default GTK_STOCK_CLOSE \ "$msg"