From 8c1f9cd57ae09b4e6fd0048b5a97810c70780465 Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 20 Feb 2020 12:22:25 -0400 Subject: [PATCH] Just grep globally if jail list not empty --- usr/local/share/bastille/create.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 6204b6f..a29136c 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -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