Skip to content

Commit

Permalink
Simplified get-vm-ip based on suggestions from NickD and zifot.
Browse files Browse the repository at this point in the history
  • Loading branch information
earlruby committed Mar 17, 2024
1 parent bdb565c commit d7e2756
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions get-vm-ip
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ if [[ -z $HOSTNAME ]]; then
exit 1
fi

MAC=$(virsh domiflist $HOSTNAME | awk '{ print $5 }' | tail -2 | head -1)
arp -a | grep $MAC | awk '{ print $2 }' | sed 's/[()]//g'
MAC=$(virsh -q domiflist $HOSTNAME | awk '{ print $5 }')
arp -e | grep -i $MAC | awk '{ print $1 }'

0 comments on commit d7e2756

Please sign in to comment.