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
# Regex to match the first IP address for the interface br0 | |
REGEX="(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}" | |
[[ $(ip -4 address | grep -A1 "br0") =~ $REGEX ]] | |
echo "${BASH_REMATCH[0]}" |