Add support for alpine

Signed-off-by: Michael Ziminsky (Z) <mgziminsky@users.noreply.github.com>
This commit is contained in:
Michael Ziminsky (Z)
2025-06-02 18:23:15 -07:00
parent 73521bb110
commit 0db48383ae
3 changed files with 106 additions and 7 deletions

View File

@@ -118,9 +118,12 @@ gravity_swap_databases() {
# Swap databases and remove or conditionally rename old database
# Number of available blocks on disk
availableBlocks=$(stat -f --format "%a" "${gravityDIR}")
# Busybox Compat: `stat` long flags unsupported
# -f flag is short form of --file-system.
# -c flag is short form of --format.
availableBlocks=$(stat -f -c "%a" "${gravityDIR}")
# Number of blocks, used by gravity.db
gravityBlocks=$(stat --format "%b" "${gravityDBfile}")
gravityBlocks=$(stat -c "%b" "${gravityDBfile}")
# Only keep the old database if available disk space is at least twice the size of the existing gravity.db.
# Better be safe than sorry...
oldAvail=false