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
#!/bin/sh | |
IF=$1 | |
# Gets MAC address of the interface | |
MY_MAC_ADDR=`ip link show $IF | awk '/ether/ {print $2}'` | |
# Get the ID of the subnet that the interface is connected to | |
MY_SUBNET_ID=`curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/$MY_MAC_ADDR/subnet-id 2> /dev/null` |
OlderNewer