From 0c268308a4cb2a751b35607976153922f8122c59 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 12 Jul 2026 23:33:10 +0200 Subject: [PATCH] feat: Preserve source image until conversion completes (#1251) --- src/disk.sh | 10 ++++------ src/network.sh | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/disk.sh b/src/disk.sh index 079e699..47bedff 100644 --- a/src/disk.sh +++ b/src/disk.sh @@ -404,15 +404,13 @@ convertDisk() { fi fi - if ! rm -f "$SOURCE_FILE"; then - rm -f "$TMP_FILE" - error "Failed to remove old $DISK_DESC image $SOURCE_FILE." + if ! mv "$TMP_FILE" "$DST_FILE"; then + error "Failed to move converted $DISK_DESC image to $DST_FILE." exit 79 fi - if ! mv "$TMP_FILE" "$DST_FILE"; then - rm -f "$TMP_FILE" - error "Failed to move converted $DISK_DESC image to $DST_FILE." + if ! rm -f "$SOURCE_FILE"; then + error "Failed to remove old $DISK_DESC image $SOURCE_FILE." exit 79 fi diff --git a/src/network.sh b/src/network.sh index c31d72c..010d48c 100644 --- a/src/network.sh +++ b/src/network.sh @@ -1620,10 +1620,8 @@ else showGuestInfo - if [[ "${NETWORK,,}" == "passt" || "${NETWORK,,}" == "slirp" ]]; then - if [ -z "$USER_PORTS" ]; then - info "Notice: because user-mode networking is active, when you need to forward custom ports to DSM, add them to the \"USER_PORTS\" variable." - fi + if isUserMode && [ -z "$USER_PORTS" ]; then + info "Notice: because user-mode networking is active, when you need to forward custom ports to DSM, add them to the \"USER_PORTS\" variable." fi fi