X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=foreman%2Fci%2Fclean.sh;h=345864b2759d5ffef0fa5440b2a3fc90a40c4dfd;hb=18ea7aaaaf32eb7027008196f2c784cd156fb5d9;hp=1bd1713eb6ec1c10fec81a9cff6db7807b079553;hpb=52639193804c6da3765066ce0f2aa365d381f897;p=genesis.git diff --git a/foreman/ci/clean.sh b/foreman/ci/clean.sh index 1bd1713..345864b 100755 --- a/foreman/ci/clean.sh +++ b/foreman/ci/clean.sh @@ -128,7 +128,7 @@ if [ $skip_vagrant -eq 0 ]; then echo "${red}Unable to destroy $vm Vagrant VM! Attempting to killall vagrant if process is hung ${reset}" killall vagrant echo "${blue}Checking if vagrant was already destroyed and no process is active...${reset}" - if ps axf | grep vagrant; then + if ps axf | grep vagrant | grep -v 'grep'; then echo "${red}Vagrant process still exists after kill...exiting ${reset}" exit 1 else @@ -158,13 +158,13 @@ if [ $skip_vagrant -eq 0 ]; then echo "${blue}Checking for any remaining virtual box processes...${reset}" ###kill virtualbox - if ps axf | grep virtualbox; then + if ps axf | grep virtualbox | grep -v 'grep'; then echo "${blue}virtualbox processes are still running. Killing any remaining VirtualBox processes...${reset}" killall virtualbox fi ###kill any leftover VMs (brute force) - if ps axf | grep VBoxHeadless; then + if ps axf | grep VBoxHeadless | grep -v 'grep'; then echo "${blue}VBoxHeadless processes are still running. Killing any remaining VBoxHeadless processes...${reset}" killall VBoxHeadless fi