commit 4353ba4d86894af8c17d18b4a9c280ca08e4c6b4 from: mischa date: Wed May 15 07:52:07 2024 UTC add additional existence check for ls /tmp/vm* commit - 1af95f8c9880b85e198e938140f2d8a794c51ef0 commit + 4353ba4d86894af8c17d18b4a9c280ca08e4c6b4 blob - 1c547d7575bf4c66c44da1d17088ef8ec18ba2f1 blob + 96bb48d1c82a6f592a0c875853086ceb76d71260 --- cpu.sh +++ cpu.sh @@ -77,10 +77,12 @@ for VM in ${OUT}; do fi done -SEEN=$(ls -1 /tmp/vm* | awk -F'/' '{print $3}') -for s in ${SEEN[@]}; do - if [[ "${OUT[*]}" != *"${s}"* ]]; then - if [ -n "${DEBUG}" ]; then echo "${s} - remove from tracking list"; fi - rm -rf /tmp/${s} - fi -done +if ls /tmp/vm* 1> /dev/null 2>&1; then + SEEN=$(ls -1 /tmp/vm* | awk -F'/' '{print $3}') + for s in ${SEEN[@]}; do + if [[ "${OUT[*]}" != *"${s}"* ]]; then + if [ -n "${DEBUG}" ]; then echo "${s} - remove from tracking list"; fi + rm -rf /tmp/${s} + fi + done +fi