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}"