common: Remove unneeded if block

This commit is contained in:
tschettervictor
2025-06-09 16:55:04 -06:00
committed by GitHub
parent c34ed5bb68
commit ac1ff045e8

View File

@@ -388,41 +388,25 @@ generate_vnet_jail_netblock() {
get_bastille_if_count get_bastille_if_count
local _bastille_if_num_range=$((_bastille_if_count + 1)) local _bastille_if_num_range=$((_bastille_if_count + 1))
if [ -n "${use_unique_bridge}" ]; then if [ -n "${use_unique_bridge}" ]; then
if [ "${_bastille_if_count}" -gt 0 ]; then for _num in $(seq 0 "${_bastille_if_num_range}"); do
for _num in $(seq 0 "${_bastille_if_num_range}"); do if ! echo "${_bastille_if_list}" | grep -oqswx "${_num}"; then
if ! echo "${_bastille_if_list}" | grep -oqswx "${_num}"; then if [ "$(echo -n "e${_num}a_${jail_name}" | awk '{print length}')" -lt 16 ]; then
if [ "$(echo -n "e${_num}a_${jail_name}" | awk '{print length}')" -lt 16 ]; then local host_epair=e${_num}a_${jail_name}
local host_epair=e${_num}a_${jail_name} local jail_epair=e${_num}b_${jail_name}
local jail_epair=e${_num}b_${jail_name} else
else local host_epair=epair${_num}a
local host_epair=epair${_num}a local jail_epair=epair${_num}b
local jail_epair=epair${_num}b
fi
break
fi fi
done break
else
if [ "$(echo -n "e0a_${jail_name}" | awk '{print length}')" -lt 16 ]; then
local _num=0
local host_epair=e${_num}a_${jail_name}
local jail_epair=e${_num}b_${jail_name}
else
local _num=0
local host_epair=epair${_num}a
local jail_epair=epair${_num}b
fi fi
fi done
else else
if [ "${_bastille_if_count}" -gt 0 ]; then for _num in $(seq 0 "${_bastille_if_num_range}"); do
for _num in $(seq 0 "${_bastille_if_num_range}"); do if ! echo "${_bastille_if_list}" | grep -oqswx "${_num}"; then
if ! echo "${_bastille_if_list}" | grep -oqswx "${_num}"; then local _jail_if="bastille${_num}"
local _jail_if="bastille${_num}" break
break fi
fi done
done
else
local _jail_if="bastille0"
fi
fi fi
## If BRIDGE is enabled, generate bridge config, else generate VNET config ## If BRIDGE is enabled, generate bridge config, else generate VNET config
if [ -n "${use_unique_bridge}" ]; then if [ -n "${use_unique_bridge}" ]; then