From cc047942bb782b09400f98fbe75329ecde9596c2 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 7 Oct 2023 12:06:22 +0200 Subject: [PATCH] refactor: Filesystem detection --- run/install.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/run/install.sh b/run/install.sh index 6625f118..7de9c7c5 100644 --- a/run/install.sh +++ b/run/install.sh @@ -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 @@ -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..."