add additional existence check for ls /tmp/vm*

This commit is contained in:
mischa 2024-05-15 09:52:07 +02:00
parent 1af95f8c98
commit 4353ba4d86
1 changed files with 9 additions and 7 deletions

2
cpu.sh
View File

@ -77,6 +77,7 @@ for VM in ${OUT}; do
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
@ -84,3 +85,4 @@ for s in ${SEEN[@]}; do
rm -rf /tmp/${s}
fi
done
fi