Merge pull request #496 from apaatsio/ifconfig-fix
Fix ips command for platforms without ifconfigpull/497/head
commit
959acc94ae
|
|
@ -5,7 +5,15 @@ function ips ()
|
||||||
{
|
{
|
||||||
about 'display all ip addresses for this host'
|
about 'display all ip addresses for this host'
|
||||||
group 'base'
|
group 'base'
|
||||||
ifconfig | awk '/inet /{ print $2 }'
|
if command -v ifconfig &>/dev/null
|
||||||
|
then
|
||||||
|
ifconfig | awk '/inet /{ print $2 }'
|
||||||
|
elif command -v ip &>/dev/null
|
||||||
|
then
|
||||||
|
ip addr | grep -oP 'inet \K[\d.]+'
|
||||||
|
else
|
||||||
|
echo "You don't have ifconfig or ip command installed!"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function down4me ()
|
function down4me ()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue