mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-24 11:12:12 +01:00
Merge pull request #181 from cynix/fix_first_vnet_jail
Fix empty interface name when creating the first VNET jail.
This commit is contained in:
@@ -144,17 +144,19 @@ generate_vnet_jail_conf() {
|
||||
## determine number of containers + 1
|
||||
## iterate num and grep all jail configs
|
||||
## define uniq_epair
|
||||
local list_jails_num=$(bastille list jails | wc -l | awk '{print $1}')
|
||||
local num_range=$(expr "${list_jails_num}" + 1)
|
||||
jail_list=$(bastille list jail)
|
||||
for _num in $(seq 0 "${num_range}"); do
|
||||
if [ -n "${jail_list}" ]; then
|
||||
local jail_list=$(bastille list jails)
|
||||
if [ -n "${jail_list}" ]; then
|
||||
local list_jails_num=$(echo "${jail_list}" | wc -l | awk '{print $1}')
|
||||
local num_range=$(expr "${list_jails_num}" + 1)
|
||||
for _num in $(seq 0 "${num_range}"); do
|
||||
if ! grep -q "e0b_bastille${_num}" "${bastille_jailsdir}"/*/jail.conf; then
|
||||
uniq_epair="bastille${_num}"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
else
|
||||
uniq_epair="bastille0"
|
||||
fi
|
||||
|
||||
## generate config
|
||||
cat << EOF > "${bastille_jail_conf}"
|
||||
|
||||
Reference in New Issue
Block a user