check if files exist in /tmp

This commit is contained in:
mischa 2024-05-14 19:37:56 +02:00
parent 5795cb8879
commit fc76bc00de
1 changed files with 3 additions and 1 deletions

4
cpu.sh
View File

@ -25,7 +25,9 @@ SEEN=$(ls -1 /tmp/vm* | awk -F'/' '{print $3}')
OUT=$(ps -uU _vmd | awk -v var="${THRESHOLD}" '$12 !~ /\// && $3 > var {print $12}')
if [ -z "$OUT" ]; then
echo "No VM over the threshold overload"
rm -rf /tmp/vm*
if ls /tmp/vm* 1> /dev/null 2>&1; then
rm -rf /tmp/vm*
fi
fi
for VM in ${OUT}; do