diff --git a/setup.sh b/setup.sh index dfd5c7e..14dda03 100755 --- a/setup.sh +++ b/setup.sh @@ -211,9 +211,13 @@ fi echo "Verifying this is the only run..." ps -ef | grep ansible-playbook | grep -v grep ansible_exists="$?" +lock_file=/tmp/ansible-playbook.lock if [[ "$ansible_exists" == 0 ]]; then echo "Playbook is already being executed. Exiting." exit 0 +elif [[ -e $lock_file ]]; then + echo "Playbook not being executed. Removing lock file." + sudo mv -v "$lock_file" "${lock_file}.diaabled" fi echo "- Verified!"