From ba4a3e9fef6fb37a3cab7ab0e6ac1b19d80783cc Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Sat, 6 May 2023 22:04:30 +0000 Subject: [PATCH] Move the lock check until after the arg parser --- command | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/command b/command index 5645182..608e593 100755 --- a/command +++ b/command @@ -2,11 +2,6 @@ BUILD=${BUILD:=default} LAB=${LAB:=0} -[ -r .lock${LAB} ] && { - echo "Lock file for LAB${LAB}, bailing" - exit -} - ## Do not touch below this line LABDIR=/var/lab STAGING=$LABDIR/staging @@ -18,6 +13,11 @@ CMD=$1 exit } +[ -r .lock${LAB} ] && { + echo "Lock file for LAB${LAB}, bailing" + exit +} + VMS=$(ls -1 build/${BUILD}/${HVN}/) for VM in $VMS; do