From b76201e25ccf021da19b5092e8c3c5eed12c3a19 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:45:55 -0700 Subject: [PATCH] =?UTF-8?q?clone:=20Fix=20cloning=20with=20=E2=80=9Cif|ip?= =?UTF-8?q?=E2=80=9D=20jail=20entry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/local/share/bastille/clone.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index 2d2dee9e..3871c6eb 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -159,17 +159,21 @@ update_jailconf() { # IP4 if [ "${_ip4}" != "not set" ]; then for _ip in ${_ip4}; do - _ip="$(echo ${_ip} | awk -F"|" '{print $2}')" - sed -i '' "/${IPX_ADDR} = .*/ s/${_ip}/${IP}/" "${JAIL_CONFIG}" - sed -i '' "/${IPX_ADDR} += .*/ s/${_ip}/127.0.0.1/" "${JAIL_CONFIG}" + if echo ${_ip} | grep -q "|"; then + _ip="$(echo ${_ip} | awk -F"|" '{print $2}')" + fi + sed -i '' "/ip4.addr = .*/ s/${_ip}/${IP}/" "${JAIL_CONFIG}" + sed -i '' "/ip4.addr += .*/ s/${_ip}/127.0.0.1/" "${JAIL_CONFIG}" done fi # IP6 if [ "${_ip6}" != "not set" ]; then for _ip in ${_ip6}; do - _ip="$(echo ${_ip} | awk -F"|" '{print $2}')" - sed -i '' "/${IPX_ADDR} = .*/ s/${_ip}/${IP}/" "${JAIL_CONFIG}" - sed -i '' "/${IPX_ADDR} += .*/ s/${_ip}/127.0.0.1/" "${JAIL_CONFIG}" + if echo ${_ip} | grep -q "|"; then + _ip="$(echo ${_ip} | awk -F"|" '{print $2}')" + fi + sed -i '' "/ip6.addr = .*/ s/${_ip}/${IP}/" "${JAIL_CONFIG}" + sed -i '' "/ip6.addr += .*/ s/${_ip}/127.0.0.1/" "${JAIL_CONFIG}" done fi fi