Just grep globally if jail list not empty

This commit is contained in:
Jose
2020-02-20 12:22:25 -04:00
parent 6b7b506c83
commit 8c1f9cd57a

View File

@@ -148,12 +148,12 @@ generate_vnet_jail_conf() {
local num_range=$(expr "${list_jails_num}" + 1)
jail_list=$(bastille list jail)
for _num in $(seq 0 "${num_range}"); do
for _jail in ${jail_list}; do
if ! grep -q "e0b_bastille${_num}" "${bastille_jailsdir}"/${_jail}/jail.conf; then
if [ -n "${jail_list}" ]; then
if ! grep -q "e0b_bastille${_num}" "${bastille_jailsdir}"/*/jail.conf; then
uniq_epair="bastille${_num}"
break
fi
done
fi
done
## generate config