mirror of
https://github.com/hackacad/bastille.git
synced 2026-01-04 03:33:41 +01:00
common: Remove unneeded if block
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user