template: Print only the first IP for the jail

This commit is contained in:
tschettervictor
2025-02-23 09:24:15 -07:00
committed by GitHub
parent d799fa37b6
commit 87e9affe46

View File

@@ -232,8 +232,8 @@ for _jail in ${JAILS}; do
## get jail ip4 and ip6 values
bastille_jail_path=$(/usr/sbin/jls -j "${_jail}" path)
if [ "$(bastille config ${_jail} get vnet)" != 'enabled' ]; then
_jail_ip4="$(bastille config ${_jail} get ip4.addr | sed 's/,/ /g')"
_jail_ip6="$(bastille config ${_jail} get ip6.addr | sed 's/,/ /g')"
_jail_ip4="$(bastille config ${_jail} get ip4.addr | sed 's/,/ /g' | awk '{print $1}')"
_jail_ip6="$(bastille config ${_jail} get ip6.addr | sed 's/,/ /g' | awk '{print $1}')"
fi
## remove value if ip4 was not set or disabled, otherwise get value
if [ "${_jail_ip4}" = "not set" ] || [ "${_jail_ip4}" = "disabled" ]; then