diff options
author | Treeve Jelbert | 2016-02-17 17:43:54 +0100 |
---|---|---|
committer | Treeve Jelbert | 2016-02-17 17:43:54 +0100 |
commit | 5326b9edfd4b0165161de78cbc0e937c43783ecd (patch) | |
tree | afcb85b65c8eddcc8c0b91ce897a9b5eb2c943bd /FUNCTIONS | |
parent | d1f89620c1604647b950d735365f90ca3a2ec23f (diff) |
FUNCTIONS: add chk_space
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-x | FUNCTIONS | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -912,3 +912,15 @@ function check_dependees_versionjump() . $GRIMOIRE/glselect.function . $GRIMOIRE/bzr_download.function . $GRIMOIRE/hg_download.function + + +# some spells need lots of disk space +# chk_space looks for $1 GB +chk_space() { +SPACE=`df --output=avail,target -l -BG|grep " /$" |cut -dG -f1 |sed "s/ //g"` +if [[ $SPACE -lt "$1" ]];then + echo "${PROBLEM_COLOR}insufficient space on root device. $SPELL requires >= $1 GB${DEFAULT_COLOR}" + return 1 +fi +return 0 +} |