diff --git a/install_newt.sh b/install_newt.sh index c830ab6..53a8dc2 100644 --- a/install_newt.sh +++ b/install_newt.sh @@ -44,12 +44,14 @@ download_newt() { url="https://github.com/${REPO}/releases/download/${version}/${file}" target="${INSTALL_DIR}/newt_${version}" + temp_target="${target}.tmp" mkdir -p "$INSTALL_DIR" info "⬇️ Lade $url herunter …" - curl -fsSL "$url" -o "$target" || { error "Download fehlgeschlagen."; exit 1; } + curl -fsSL "$url" -o "$temp_target" || { error "Download fehlgeschlagen."; rm -f "$temp_target"; exit 1; } - chmod +x "$target" + chmod +x "$temp_target" + mv "$temp_target" "$target" ln -sf "$target" "$SYMLINK" info "✅ newt ${version} installiert als ${target}" } @@ -137,7 +139,6 @@ perform_reinstall() { info "📦 Neueste Version: ${version}" download_newt "$version" cleanup_old_versions - sudo systemctl stop "$SERVICE_NAME" || true sudo rm -f "$SERVICE_FILE" || true setup_systemd_service info "🚀 Reinstallation abgeschlossen!" @@ -159,4 +160,4 @@ main() { esac } -main "$@" \ No newline at end of file +main "$@"