From 4302445eb50047feac1a15294d4e99420b43742a Mon Sep 17 00:00:00 2001 From: Daniel Dowse - Freelancer Date: Fri, 8 Apr 2022 15:26:53 +0200 Subject: [PATCH] Add variable JAIL_IP6 to access ip6.addr in templates --- usr/local/share/bastille/template.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index 2d928bbd..7747cd23 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -229,6 +229,7 @@ for _jail in ${JAILS}; do bastille_jail_path=$(/usr/sbin/jls -j "${_jail}" path) if [ "$(bastille config $TARGET get vnet)" != 'enabled' ]; then _jail_ip=$(/usr/sbin/jls -j "${_jail}" ip4.addr 2>/dev/null) + _jail_ip6=$(/usr/sbin/jls -j "${_jail}" ip6.addr 2>/dev/null) if [ -z "${_jail_ip}" -o "${_jail_ip}" = "-" ]; then error_notify "Jail IP not found: ${_jail}" _jail_ip='' # In case it was -. -- cwells @@ -251,7 +252,7 @@ for _jail in ${JAILS}; do # Build a list of sed commands like this: -e 's/${username}/root/g' -e 's/${domain}/example.com/g' # Values provided by default (without being defined by the user) are listed here. -- cwells - ARG_REPLACEMENTS="-e 's/\${JAIL_IP}/${_jail_ip}/g' -e 's/\${JAIL_NAME}/${_jail}/g'" + ARG_REPLACEMENTS="-e 's/\${JAIL_IP}/${_jail_ip}/g' -e 's/\${JAIL_IP6}/${_jail_ip6}/g' -e 's/\${JAIL_NAME}/${_jail}/g'" # This is parsed outside the HOOKS loop so an ARG file can be used with a Bastillefile. -- cwells if [ -s "${bastille_template}/ARG" ]; then while read _line; do