Created
June 29, 2018 10:56
-
-
Save glazeus/676b9855fb8bdc8b239f1c92bec0f21d to your computer and use it in GitHub Desktop.
get-ip-from-srv-record
This file contains hidden or 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
| i=0; for srvrecord in `host -t SRV $SrvServiceDiscoveryServiceDns | awk '{ print substr($8, 1, length($8)-1)}'`; do arr[$i]=$(host $srvrecord | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])'); echo "arr[$i] is ${arr[$i]}"; i=$(expr $i + 1); done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment