add additional existence check for ls /tmp/vm*
This commit is contained in:
parent
1af95f8c98
commit
4353ba4d86
8
cpu.sh
8
cpu.sh
|
@ -77,10 +77,12 @@ for VM in ${OUT}; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
SEEN=$(ls -1 /tmp/vm* | awk -F'/' '{print $3}')
|
if ls /tmp/vm* 1> /dev/null 2>&1; then
|
||||||
for s in ${SEEN[@]}; do
|
SEEN=$(ls -1 /tmp/vm* | awk -F'/' '{print $3}')
|
||||||
|
for s in ${SEEN[@]}; do
|
||||||
if [[ "${OUT[*]}" != *"${s}"* ]]; then
|
if [[ "${OUT[*]}" != *"${s}"* ]]; then
|
||||||
if [ -n "${DEBUG}" ]; then echo "${s} - remove from tracking list"; fi
|
if [ -n "${DEBUG}" ]; then echo "${s} - remove from tracking list"; fi
|
||||||
rm -rf /tmp/${s}
|
rm -rf /tmp/${s}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue