From 7b08b49e97d107ada1f68aa75f80f054909f0945 Mon Sep 17 00:00:00 2001 From: Anathema Date: Fri, 19 Aug 2011 15:25:19 +0200 Subject: [PATCH] added check in list_tombs(): if a tomb usage is greater or equals to 90%, then the script prints a warning --- src/tomb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tomb b/src/tomb index 3f0832c..5526b82 100755 --- a/src/tomb +++ b/src/tomb @@ -1034,7 +1034,7 @@ list_tombs() { tombused=${ts[(ws:;:)2]} tombavail=${ts[(ws:;:)3]} tombpercent=${ts[(ws:;:)4]} - + tombp=${tombpercent%%%} tombsince=`date --date=@${mapper[(ws:.:)3]} +%c` # breaking up such strings is good for translation @@ -1054,6 +1054,10 @@ list_tombs() { print -n "$fg_no_bold[white] free (" print -n "$fg_bold[white]$tombpercent" print "$fg_no_bold[white] full)" + + if [[ ${tombp} -ge 90 ]]; then + error "Your tomb is almost full!" + fi print -n "$fg_no_bold[green]$tombname" print -n "$fg_no_bold[white] open since "