Commit Diff


commit - 5795cb8879a18ea132507f0e12de90aad26c0d99
commit + fc76bc00dee7b1210f2c1e943a50ed6da9247fc7
blob - 3add5a9214877be8877921c8fbdbf927252ee5ea
blob + 3b7a999e09f7359f78d317625f3aaa601501eecd
--- cpu.sh
+++ cpu.sh
@@ -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