From cef287a4161cabc5e17514b0eb942d2d37eca4ce Mon Sep 17 00:00:00 2001 From: Robbie Ferguson Date: Thu, 21 Jun 2018 10:06:14 -0400 Subject: [PATCH] Do not proceed if disk is not big enough --- nems-build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nems-build.sh b/nems-build.sh index 6d2446e..2109cdb 100755 --- a/nems-build.sh +++ b/nems-build.sh @@ -36,6 +36,11 @@ If you run this program, you will lose everything! exit fi +diskfree=$(($(stat -f --format="%a*%S" .))) +if (( "$diskfree" < "8589934592" )); then + echo You do not have enough free space to build. Did you resize the root fs? + exit +fi if [[ ! -d /var/log/nems ]]; then mkdir /var/log/nems