mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-19 19:15:14 +00:00
added check in list_tombs(): if a tomb usage is greater or equals to 90%, then the script prints a warning
This commit is contained in:
parent
938cb01af0
commit
7b08b49e97
6
src/tomb
6
src/tomb
@ -1034,7 +1034,7 @@ list_tombs() {
|
|||||||
tombused=${ts[(ws:;:)2]}
|
tombused=${ts[(ws:;:)2]}
|
||||||
tombavail=${ts[(ws:;:)3]}
|
tombavail=${ts[(ws:;:)3]}
|
||||||
tombpercent=${ts[(ws:;:)4]}
|
tombpercent=${ts[(ws:;:)4]}
|
||||||
|
tombp=${tombpercent%%%}
|
||||||
tombsince=`date --date=@${mapper[(ws:.:)3]} +%c`
|
tombsince=`date --date=@${mapper[(ws:.:)3]} +%c`
|
||||||
|
|
||||||
# breaking up such strings is good for translation
|
# breaking up such strings is good for translation
|
||||||
@ -1054,6 +1054,10 @@ list_tombs() {
|
|||||||
print -n "$fg_no_bold[white] free ("
|
print -n "$fg_no_bold[white] free ("
|
||||||
print -n "$fg_bold[white]$tombpercent"
|
print -n "$fg_bold[white]$tombpercent"
|
||||||
print "$fg_no_bold[white] full)"
|
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[green]$tombname"
|
||||||
print -n "$fg_no_bold[white] open since "
|
print -n "$fg_no_bold[white] open since "
|
||||||
|
Loading…
Reference in New Issue
Block a user