From 6e850785a207e6f34ab43f2461dc8c328c35ad0d Mon Sep 17 00:00:00 2001 From: cynix Date: Mon, 30 Mar 2020 08:41:33 +0000 Subject: [PATCH] Fix empty interface name when creating the first VNET jail. Fixes #170. --- usr/local/share/bastille/create.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 6a19acf..82f01d8 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -147,14 +147,16 @@ generate_vnet_jail_conf() { 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 + if [ -n "${jail_list}" ]; then + 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}"