From 8de0b4541acf35d60f8ee6c6043d27f407341c26 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:41:57 -0400 Subject: [PATCH] Add collision detection --- install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.sh b/install.sh index 0a091ee..042ed5e 100755 --- a/install.sh +++ b/install.sh @@ -375,6 +375,11 @@ case ${install_option} in ;; esac +if [[ -f /tmp/pvc-install.lock ]]; then + echo "An instance of 'install.sh' is already running!" + exit 1 +fi +touch /tmp/pvc-install.lock titlestring_text="| Proceeding with installation of host '${target_hostname}'. |" titlestring_len="$(( $( wc -c <<<"${titlestring_text}" ) - 2 ))" @@ -407,6 +412,7 @@ cleanup() { umount ${target} >&2 vgchange -an >&2 rmdir ${target} >&2 + rm /tmp/pvc-install.lock echo "done." echo }