From 0341789c447d77a32dd72ce5041f91d1a62794fa Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:37:41 -0700 Subject: [PATCH] Update network.sh --- usr/local/share/bastille/network.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/local/share/bastille/network.sh b/usr/local/share/bastille/network.sh index e94d45a1..15d719ec 100644 --- a/usr/local/share/bastille/network.sh +++ b/usr/local/share/bastille/network.sh @@ -420,16 +420,18 @@ add_vlan() { local _jail_config="${bastille_jailsdir}/${_jailname}/jail.conf" local _jail_rc_config="${bastille_jailsdir}/${_jailname}/root/etc/rc.conf" if [ "${VNET_JAIL}" -eq 1 ]; then - local _jail_epair_num="$(grep ${_interface} ${_jail_config} | grep -Eo "bastille[0-9]+" | grep -Eo "[0-9]+")" + local _jail_epair_num="$(grep ${_interface} ${_jail_config} | grep -Eo -m 1 "bastille[0-9]+" | grep -Eo "[0-9]+")" local _jail_vnet="$(grep "e0b_bastille${_jail_epair_num}_name" ${_jail_rc_config} | grep -Eo "vnet[0-9]+" | grep -Eo "[0-9]+")" elif [ "${BRIDGE_VNET_JAIL}" -eq 1 ]; then - local _jail_epair_num="$(grep ${_interface} ${_jail_config} | grep -Eo "epair[0-9]+" | grep -Eo "[0-9]+")" + local _jail_epair_num="$(grep ${_interface} ${_jail_config} | grep -Eo -m 1 "epair[0-9]+" | grep -Eo "[0-9]+")" local _jail_vnet="$(grep "e.*${_jail_epair_num}b.*_name" ${_jail_rc_config} | grep -Eo "vnet[0-9]+" | grep -Eo "[0-9]+")" fi if grep -Eq "ifconfig_${_jail_vnet}_${_vlan_id}" "${bastille_jailsdir}/${_jailname}/root/etc/rc.conf"; then error_exit "VLAN has already been added: VLAN ${_vlan_id}" else + bastille start "${_jailname}" bastille template "${_jailname}" ${bastille_template_vlan} --arg VLANID="${_vlan_id}" --arg IFCONFIG="inet ${_ip}" --arg JAIL_VNET="${_jail_vnet}" + bastille restart "${_jailname}" fi info "[${_jailname}]:"