[WIP] shellcheck linting

This commit is contained in:
Juan David Hurtado G
2024-12-08 20:57:43 -05:00
parent 7e6a9fa896
commit 8808e8a5a4
7 changed files with 18 additions and 14 deletions

View File

@@ -58,6 +58,7 @@ validate_ip() {
if [ -n "${ip6}" ]; then
info "Valid: (${ip6})."
IPX_ADDR="ip6.addr"
# shellcheck disable=SC2034
IP6_MODE="new"
else
local IFS
@@ -104,8 +105,8 @@ update_jailconf_vnet() {
bastille_jail_rc_conf="${bastille_jailsdir}/${NEWNAME}/root/etc/rc.conf"
# Determine number of containers and define an uniq_epair
local list_jails_num=$(bastille list jails | wc -l | awk '{print $1}')
local num_range=$(expr "${list_jails_num}" + 1)
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
@@ -125,7 +126,7 @@ update_jailconf_vnet() {
sed -i '' "s|ifconfig_e0b_bastille.*_name|ifconfig_e0b_${uniq_epair}_name|" "${bastille_jail_rc_conf}"
# If 0.0.0.0 set DHCP, else set static IP address
if [ "${IP}" == "0.0.0.0" ]; then
if [ "${IP}" = "0.0.0.0" ]; then
sysrc -f "${bastille_jail_rc_conf}" ifconfig_vnet0="SYNCDHCP"
else
sysrc -f "${bastille_jail_rc_conf}" ifconfig_vnet0="inet ${IP}"