Unverified Commit a19bf2f0 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Check if storage folder is writeable (#1004)

parent bee68ee5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -69,6 +69,10 @@ if [ ! -d "$STORAGE" ]; then
  error "Storage folder ($STORAGE) not found!" && exit 13
fi

if [ ! -w "$STORAGE" ]; then
  error "Storage folder ($STORAGE) is not writeable!" && exit 13
fi

# Check filesystem
FS=$(stat -f -c %T "$STORAGE")

@@ -99,7 +103,8 @@ SYS="${SYS/-generic/}"
FS="${FS/UNKNOWN //}"
FS="${FS/ext2\/ext3/ext4}"
FS=$(echo "$FS" | sed 's/[)(]//g')
SPACE=$(df --output=avail -B 1 "$STORAGE" | tail -n 1)
SPACE=$(df --outpu
t=avail -B 1 "$STORAGE" | tail -n 1)
SPACE_GB=$(formatBytes "$SPACE" "down")
AVAIL_MEM=$(formatBytes "$RAM_AVAIL" "down")
TOTAL_MEM=$(formatBytes "$RAM_TOTAL" "up")