Fixed runme.sh script for free space

In case there is more than 1Tb space available
the free space check can not pass

Change-Id: I965aa45448c0a081daf711208af944a54683b632
This commit is contained in:
Andrey Grebennikov 2016-02-22 23:25:27 -08:00
parent ef12349e2f
commit 7294f6dff0
1 changed files with 4 additions and 2 deletions

View File

@ -193,11 +193,13 @@ function init()
# check disk space
function check_free_space()
{
#directory should have at least 50G of free space
local min_free_g="50"
let min_free=${min_free_g}*1024*1024
local sys_free=''
log "Checking free space for ${Config["vmsworkdir"]} folder partition..."
sys_free=$(sudo df "${Config["vmsworkdir"]}" --total -k -h --output=avail | head -n2 | tail -n1)
if [ "${sys_free/G/}" -lt "${min_free_g}" ]; then
sys_free=$(sudo df "${Config["vmsworkdir"]}" --total -k --output=avail | head -n2 | tail -n1)
if [ "${sys_free}" -lt "${min_free}" ]; then
log "Err: You have not enough free space ${sys_free} at ${Config["vmsworkdir"]}, required - ${min_free_g}G!"
exit 2
fi