#!/bin/sh # requires curl for ext ip and wireless-tools for wlan [ $1 ] || $0 -w for x;do case $x in -a)$0 -w -e -i;; -e)curl -s ip.cutup.org;echo;; -h)echo "use: $(basename $0) [-a][-e][-h][-i][-w]";; -i)/sbin/ifconfig 2>/dev/null | awk ' $1 == "wlan0" { x=1 } x && $1 == "inet" { x=0; split($2,a,":"); print a[2]} ';; -w)/usr/sbin/iwconfig 2>/dev/null | awk ' $1 == "wlan0" && $2 != "NOT" && $3 != "READY" { split($NF,a,"\""); print a[2] }';; esac;shift;done