SATS/lib/netid/ip

10 lines
197 B
Bash
Executable File

#!/bin/bash
# (1) Get wireless iface #
IFACE=`ifconfig | grep -o -P "^w\w+"`;
# (2) Get Access Point ID #
IP=`ifconfig $IFACE | grep -o -P 'inet addr:[\d\.]+' | sed 's/inet addr://'`;
echo $IP;