Created
July 20, 2022 17:15
-
-
Save aboron/95a0d41241074a9bbdd864ca5e9901f9 to your computer and use it in GitHub Desktop.
Show the IP addresses assigned to all smartos zone nics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
if [ "$#" -ne 1 ]; then | |
vmadm list -p -o uuid | while read line ;do | |
vmadm get $line | /usr/xpg4/bin/grep -E 'mac|"ip"|zonename|interface|alias' | |
echo | |
done | |
exit 0 | |
fi | |
vmadm list -p -o uuid | while read line ;do | |
results=`vmadm get $line | /usr/xpg4/bin/grep -E '"ip"' | /usr/xpg4/bin/grep -c $1` | |
if [ $results -ge 1 ]; then | |
vmadm get $line | /usr/xpg4/bin/grep -E 'zonename|alias' | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment