pull/1000/head
MaYuming 2017-07-08 10:56:04 +08:00
commit a61edb6a25
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.]+'