diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index 4db5d0f5..80a53e69 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -203,7 +203,7 @@ update_jailconf_vnet() { if echo ${_if} | grep -Eoq 'epair[0-9]+'; then # Update bridged VNET config for _num in $(seq 0 "${_epair_num_range}"); do - if ! grep -Eoq "(bastille${_num}|epair${_num})" ${bastille_jailsdir}/*/jail.conf && ! ifconfig | grep -Eoq "(e${_num}a|epair${_num}a|bastille${_num})"; then + if ! grep -Eoq "(bastille${_num}|epair${_num})" ${bastille_jailsdir}/*/jail.conf && ! ifconfig -g epair | grep -Eosq "(e${_num}a|epair${_num}a|bastille${_num})"; then # Generate new epair name if [ "$(echo -n "e${_num}a_${NEWNAME}" | awk '{print length}')" -lt 16 ]; then local _new_host_epair="e${_num}a_${NEWNAME}" @@ -272,7 +272,7 @@ update_jailconf_vnet() { elif echo ${_if} | grep -Eoq 'bastille[0-9]+'; then # Update VNET config for _num in $(seq 0 "${_epair_num_range}"); do - if ! grep -Eoq "(bastille${_num}|epair${_num})" ${bastille_jailsdir}/*/jail.conf && ! ifconfig | grep -Eoq "(e${_num}a|epair${_num}a|bastille${_num})"; then + if ! grep -Eoq "(bastille${_num}|epair${_num})" ${bastille_jailsdir}/*/jail.conf && ! ifconfig -g epair | grep -Eosq "(e${_num}a|epair${_num}a|bastille${_num})"; then # Update jail.conf epair name local uniq_epair="bastille${_num}" local _jail_vnet="$(grep ${_if} "${_rc_conf}" | grep -Eo -m 1 "vnet[0-9]+")" diff --git a/usr/local/share/bastille/network.sh b/usr/local/share/bastille/network.sh index ea32e611..a1e6a915 100644 --- a/usr/local/share/bastille/network.sh +++ b/usr/local/share/bastille/network.sh @@ -239,7 +239,7 @@ add_interface() { if [ "${BRIDGE}" -eq 1 ]; then if [ "${_epair_count}" -gt 0 ]; then for _num in $(seq 0 "${_epair_num_range}"); do - if ! grep -Eosq "(bastille${_num}|epair${_num})" ${bastille_jailsdir}/*/jail.conf && ! ifconfig | grep -Eosq "(e${_num}a|epair${_num}a|bastille${_num})"; then + if ! grep -Eosq "(bastille${_num}|epair${_num})" ${bastille_jailsdir}/*/jail.conf && ! ifconfig -g epair | grep -Eosq "(e${_num}a|epair${_num}a|bastille${_num})"; then if [ "$(echo -n "e${_num}a_${jail_name}" | awk '{print length}')" -lt 16 ]; then local host_epair=e${_num}a_${_jailname} local jail_epair=e${_num}b_${_jailname}