From 419c950dc5cfeee40920d687cd60816660fd0550 Mon Sep 17 00:00:00 2001
From: Cullum Smith <cullum@sacredheartsc.com>
Date: Wed, 17 Jul 2024 08:04:16 -0400
Subject: fix boxconf argument parsing

---
 boxconf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'boxconf')

diff --git a/boxconf b/boxconf
index c9955e7..3f7b311 100755
--- a/boxconf
+++ b/boxconf
@@ -26,8 +26,8 @@ while getopts :hde:s:X _bc_opt; do
   esac
 done
 
-[ $(( OPTIND - $# )) -eq 1 ] && usage 'HOST not specified'
-eval "BOXCONF_HOSTNAME=\$$#"
+[ $(( OPTIND - $# )) -eq 0 ] || usage
+eval "BOXCONF_HOSTNAME=\$$((OPTIND))"
 
 for _bc_lib in "${BOXCONF_ROOT}/lib"/*; do
   . "$_bc_lib"
-- 
cgit v1.2.3