🐛 free-gigs: actually make it work on busybox
This commit is contained in:
parent
beba25bd1f
commit
7e91deb06b
1 changed files with 2 additions and 1 deletions
|
@ -19,10 +19,11 @@ if free_bytes=$(stat -f --format="%a*%S" "$target" 2>/dev/null); then
|
|||
:
|
||||
elif free_bytes=$(stat -f "%a*%S" "$target" 2>/dev/null); then
|
||||
# BSD/macOS stat
|
||||
# XXX untested
|
||||
:
|
||||
else
|
||||
# BusyBox stat fallback
|
||||
free_bytes=$(stat -f "$target" | awk '/Block size:/ {bs=$3} /Available:/ {av=$2} END {print av*bs}')
|
||||
free_bytes=$(stat -f -c "%a*%S" "$target")
|
||||
fi
|
||||
|
||||
free_gb=$((free_bytes / factor / factor / factor))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue