fix ips issue #998

pull/1000/head
MaYuming 2017-07-06 14:50:53 +08:00
parent f13e04fdb0
commit e687857eb0
1 changed files with 1 additions and 1 deletions

View File

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