1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 20:01:56 +00:00
srs/trunk/auto/local_ip.sh

7 lines
168 B
Bash
Raw Normal View History

2014-03-23 03:25:42 +00:00
ip=`ifconfig 2>&1|grep 'inet addr'|grep -v '127.0.0.1'|awk 'NR==1 {print $2}'|awk -F ':' '{print $2}'`
if [[ -z $ip ]]; then
2014-03-23 10:03:24 +00:00
echo "127.0.0.1"
2014-03-23 03:25:42 +00:00
else
echo $ip
fi