commit c40181bf7bd2e291dfa5dac8e703fc17d8020446 from: mischa date: Tue May 21 10:50:01 2024 UTC check if VM is already running before deploying commit - db076d5a348dfa4cc2ea181083b749bd14fff894 commit + c40181bf7bd2e291dfa5dac8e703fc17d8020446 blob - 77edb2a39d7e386db5cb8f0f3faea2a902392f56 blob + 85e911e2a16684076711a2dcf34c777f643f72d9 --- launch.sh +++ launch.sh @@ -41,6 +41,11 @@ else chmod 600 ${VMS}/${1}.txt fi +if vmctl show ${1} | grep running >/dev/null 2>&1; then + echo "ERR: VM ${1} is already running..." + exit 1 +fi + INSTANCE=$(awk -F'=' '/^instance/ {print $2}' ${VMS}/${1}.txt | tr -d '"') if [[ -z ${INSTANCE} ]]; then INSTANCE=${1}