From 764aa183dd4d3266872b30f3175ccb31298cc9e8 Mon Sep 17 00:00:00 2001 From: enki Date: Wed, 27 Aug 2025 16:05:05 -0700 Subject: [PATCH] Fix setup_systemd.sh copy issue when running from install dir --- scripts/setup_systemd.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/setup_systemd.sh b/scripts/setup_systemd.sh index b317a9c..4595e11 100755 --- a/scripts/setup_systemd.sh +++ b/scripts/setup_systemd.sh @@ -104,11 +104,15 @@ echo "📁 Setting up installation directory..." mkdir -p "$INSTALL_DIR"/{bin,data,configs,logs,backups,web} mkdir -p "$INSTALL_DIR/data"/{blobs,chunks,transcoded,thumbnails,metadata} -# Copy files -cp bin/gateway "$INSTALL_DIR/bin/" -cp -r configs/* "$INSTALL_DIR/configs/" 2>/dev/null || true -cp -r internal/web "$INSTALL_DIR/" -cp -r scripts "$INSTALL_DIR/" +# Copy files (only if not already in install directory) +if [ "$PWD" != "$INSTALL_DIR" ]; then + cp bin/gateway "$INSTALL_DIR/bin/" + cp -r configs/* "$INSTALL_DIR/configs/" 2>/dev/null || true + cp -r internal/web "$INSTALL_DIR/" + cp -r scripts "$INSTALL_DIR/" +else + echo "â„šī¸ Already running from install directory, skipping copy" +fi # Set permissions chown -R "$SERVICE_USER:$SERVICE_GROUP" "$INSTALL_DIR"