fix ips issue #998

This commit is contained in:
MaYuming
2017-07-06 14:50:53 +08:00
parent f13e04fdb0
commit e687857eb0

View File

@@ -7,7 +7,7 @@ function ips ()
group 'base'
if command -v ifconfig &>/dev/null
then
ifconfig | awk '/inet /{ print $2 }'
ifconfig | grep -E "inet "|sed 's/addr://g' | awk '{print $2}'
elif command -v ip &>/dev/null
then
ip addr | grep -oP 'inet \K[\d.]+'