Skip to content

Commit

Permalink
refactor: Filesystem detection
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Oct 7, 2023
1 parent 912aabc commit cc04794
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions run/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,9 @@ rm -f "$STORAGE"/"$BASE".agent
rm -f "$STORAGE"/"$BASE".boot.img
rm -f "$STORAGE"/"$BASE".system.img

TMP="/tmp/dsm"
FS=$(stat -f -c %T "$STORAGE")

if [[ "$FS" == "ext"* ]]; then
TMP="$STORAGE/tmp"
else
TMP="/tmp/dsm"
fi

RDC="$STORAGE/dsm.rd"
[[ "$FS" == "ext"* ]] && TMP="$STORAGE/tmp"
rm -rf "$TMP" && mkdir -p "$TMP"

# Check free diskspace
Expand All @@ -49,6 +43,8 @@ SPACE=$(df --output=avail -B 1 "$TMP" | tail -n 1)

[[ "${DEBUG}" == [Yy1]* ]] && set -x

RDC="$STORAGE/dsm.rd"

if [ ! -f "${RDC}" ]; then

info "Install: Downloading installer..."
Expand Down

0 comments on commit cc04794

Please sign in to comment.