Permalink
Browse files

Only output first IP if multiple

  • Loading branch information...
NEMS Linux
NEMS Linux committed Feb 9, 2019
1 parent bf7b57e commit 7225832c9603cb09f1cf40be3a5a603fcf05d814
Showing with 1 addition and 1 deletion.
  1. +1 −1 info.sh
@@ -12,7 +12,7 @@ me=`basename "$0"`
# Output local IP address
if [[ $COMMAND == "ip" ]]; then
# Work with any NIC
/sbin/ip -f inet addr show $($0 nic) | grep -Po 'inet \K[\d.]+'
/sbin/ip -f inet addr show $($0 nic) | grep -Po 'inet \K[\d.]+' | head -n 1

elif [[ $COMMAND == "nic" ]]; then
# Show the active NIC

0 comments on commit 7225832

Please sign in to comment.