Firewall-SOSDG/bin/get_default_ip

8 lines
258 B
Plaintext
Raw Normal View History

#!/bin/bash
# Thanks to the people at:
# http://www.linuxquestions.org/questions/programming-9/using-grep-and-awk-to-get-ip-address-627626/
echo $(expr "`ifconfig $1`" : '.*inet addr:\([^ ]*\).*')
#ifconfig ${EXTIF}| awk -F ' *|:' '/inet addr/{print $4}'