From 9a47a6c573594f801fa30e5882ee322b9a3c9fd2 Mon Sep 17 00:00:00 2001 From: yaazkal Date: Tue, 28 Dec 2021 21:19:54 -0500 Subject: [PATCH 1/3] [REF] SC2003: expr is antiquated --- usr/local/share/bastille/create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 26a97f15..27cd8289 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -191,7 +191,7 @@ generate_vnet_jail_conf() { 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) + local num_range=$((list_jails_num + 1)) for _num in $(seq 0 "${num_range}"); do if ! grep -q "e${_num}b" "${bastille_jailsdir}"/*/jail.conf; then uniq_epair="bastille${_num}" From c8545e8598de998948662798e5b4b60f7d1dc9c0 Mon Sep 17 00:00:00 2001 From: yaazkal Date: Tue, 28 Dec 2021 21:22:30 -0500 Subject: [PATCH 2/3] [REF] indentation: change tab to spaces --- usr/local/share/bastille/create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 27cd8289..36fea56a 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -195,7 +195,7 @@ generate_vnet_jail_conf() { for _num in $(seq 0 "${num_range}"); do if ! grep -q "e${_num}b" "${bastille_jailsdir}"/*/jail.conf; then uniq_epair="bastille${_num}" - uniq_epair_bridge="${_num}" + uniq_epair_bridge="${_num}" break fi done From 17e4fa78f9443b0ac2b374a9077ff13b5e031949 Mon Sep 17 00:00:00 2001 From: yaazkal Date: Tue, 28 Dec 2021 22:42:52 -0500 Subject: [PATCH 3/3] [FIX] vnet: use the right search pattern to choose the unique epair --- usr/local/share/bastille/create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 36fea56a..b1b43b42 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -193,7 +193,7 @@ generate_vnet_jail_conf() { local list_jails_num=$(echo "${jail_list}" | wc -l | awk '{print $1}') local num_range=$((list_jails_num + 1)) for _num in $(seq 0 "${num_range}"); do - if ! grep -q "e${_num}b" "${bastille_jailsdir}"/*/jail.conf; then + if ! grep -q "e[0-9]b_bastille${_num}" "${bastille_jailsdir}"/*/jail.conf; then uniq_epair="bastille${_num}" uniq_epair_bridge="${_num}" break