diff --git a/vm/archlinux-vm.sh b/vm/archlinux-vm.sh index 84264d857..dc681a694 100644 --- a/vm/archlinux-vm.sh +++ b/vm/archlinux-vm.sh @@ -513,7 +513,7 @@ DISK_REF_IMPORTED="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully impo [[ -z "$DISK_REF_IMPORTED" ]] && { msg_error "Unable to determine imported disk reference." echo "$IMPORT_OUT" - exit 1 + exit 226 } msg_ok "Imported disk (${CL}${BL}${DISK_REF_IMPORTED}${CL})" diff --git a/vm/docker-vm.sh b/vm/docker-vm.sh index 503925121..42fb22091 100644 --- a/vm/docker-vm.sh +++ b/vm/docker-vm.sh @@ -638,7 +638,7 @@ DISK_REF_IMPORTED="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully impo [[ -z "$DISK_REF_IMPORTED" ]] && { msg_error "Unable to determine imported disk reference." echo "$IMPORT_OUT" - exit 1 + exit 226 } msg_ok "Imported disk (${CL}${BL}${DISK_REF_IMPORTED}${CL})" diff --git a/vm/haos-vm.sh b/vm/haos-vm.sh index 3edd59494..f0d58afe8 100644 --- a/vm/haos-vm.sh +++ b/vm/haos-vm.sh @@ -221,7 +221,7 @@ function ensure_pv() { if ! apt-get update -qq &>/dev/null || ! apt-get install -y pv &>/dev/null; then msg_error "Failed to install pv automatically." echo -e "\nPlease run manually on the Proxmox host:\n apt install pv\n" - exit 1 + exit 237 fi msg_ok "Installed pv" fi @@ -249,14 +249,14 @@ function download_and_validate_xz() { if ! curl -fSL -o "$file" "$url"; then msg_error "Download failed: $url" rm -f "$file" - exit 1 + exit 115 fi # Validate again if ! xz -t "$file" &>/dev/null; then msg_error "Downloaded file $(basename "$file") is corrupted. Please try again later." rm -f "$file" - exit 1 + exit 115 fi msg_ok "Downloaded and validated $(basename "$file")" } @@ -272,7 +272,7 @@ function extract_xz_with_pv() { if ! xz -dc "$file" | pv -N "Extracting" >"$target"; then msg_error "Failed to extract $file" rm -f "$target" - exit 1 + exit 115 fi msg_ok "Decompressed to $target" } @@ -592,7 +592,7 @@ DISK_REF="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully imported disk [[ -z "$DISK_REF" ]] && { msg_error "Unable to determine imported disk reference." echo "$IMPORT_OUT" - exit 1 + exit 226 } msg_ok "Imported disk (${CL}${BL}${DISK_REF}${CL})" diff --git a/vm/openwrt-vm.sh b/vm/openwrt-vm.sh index 01ee4a51e..c7e030245 100644 --- a/vm/openwrt-vm.sh +++ b/vm/openwrt-vm.sh @@ -556,7 +556,7 @@ fi if [[ -z "$DISK_REF" ]]; then msg_error "Unable to determine imported disk reference." echo "$IMPORT_OUT" - exit 1 + exit 226 fi qm set $VMID \ @@ -635,7 +635,7 @@ if qm status "$VMID" | grep -q "running"; then msg_ok "Network interfaces configured in OpenWrt" else msg_error "VM is not running" - exit 1 + exit 226 fi msg_info "Waiting for OpenWrt to shut down..." diff --git a/vm/opnsense-vm.sh b/vm/opnsense-vm.sh index 4048483a0..23fad87f1 100644 --- a/vm/opnsense-vm.sh +++ b/vm/opnsense-vm.sh @@ -616,7 +616,7 @@ for ver in $RELEASE_LIST; do done if [ -z "$URL" ]; then msg_error "Could not find generic FreeBSD amd64 qcow2 image (non-UFS/ZFS)." - exit 1 + exit 115 fi msg_ok "Download URL: ${CL}${BL}${URL}${CL}" @@ -626,7 +626,7 @@ if ! check_disk_space "$TEMP_DIR" 20; then msg_error "Insufficient disk space in temporary directory ($TEMP_DIR)." msg_error "Available: ${AVAILABLE_GB}, Required: ~20GB for FreeBSD image decompression." msg_error "Please free up space or ensure /tmp has sufficient storage." - exit 1 + exit 214 fi msg_info "Downloading FreeBSD Image" @@ -639,7 +639,7 @@ if ! check_disk_space "$TEMP_DIR" 15; then AVAILABLE_GB=$(df -h "$TEMP_DIR" | awk 'NR==2 {print $4}') msg_error "Insufficient disk space for decompression." msg_error "Available: ${AVAILABLE_GB}, Required: ~15GB for decompressed image." - exit 1 + exit 214 fi msg_info "Decompressing FreeBSD Image (this may take a few minutes)" @@ -648,7 +648,7 @@ if ! unxz -cv $(basename $URL) >${FILE}; then msg_error "Failed to decompress FreeBSD image." msg_error "This is usually caused by insufficient disk space." df -h "$TEMP_DIR" - exit 1 + exit 115 fi # Remove the compressed file to save space diff --git a/vm/truenas-vm.sh b/vm/truenas-vm.sh index 2e4002893..6066a29d6 100644 --- a/vm/truenas-vm.sh +++ b/vm/truenas-vm.sh @@ -305,7 +305,7 @@ function advanced_settings() { if [ $ISO_COUNT -eq 0 ]; then echo "No ISOs found." - exit 1 + exit 115 fi # Identify the index of the last stable release @@ -529,7 +529,7 @@ if [ -z "${SELECTED_ISO:-}" ]; then if [ -z "$SELECTED_ISO" ]; then msg_error "Could not find a stable ISO for fallback." - exit 1 + exit 115 fi fi diff --git a/vm/umbrel-os-vm.sh b/vm/umbrel-os-vm.sh index b8dca5d96..af9bc41dc 100644 --- a/vm/umbrel-os-vm.sh +++ b/vm/umbrel-os-vm.sh @@ -215,7 +215,7 @@ function ensure_pv() { if ! apt-get update -qq &>/dev/null || ! apt-get install -y pv &>/dev/null; then msg_error "Failed to install pv automatically." echo -e "\nPlease run manually on the Proxmox host:\n apt install pv\n" - exit 1 + exit 237 fi msg_ok "Installed pv" fi @@ -243,14 +243,14 @@ function download_and_validate_xz() { if ! curl -fSL -o "$file" "$url"; then msg_error "Download failed: $url" rm -f "$file" - exit 1 + exit 115 fi # Validate again if ! xz -t "$file" &>/dev/null; then msg_error "Downloaded file $(basename "$file") is corrupted. Please try again later." rm -f "$file" - exit 1 + exit 115 fi msg_ok "Downloaded and validated $(basename "$file")" } @@ -266,7 +266,7 @@ function extract_xz_with_pv() { if ! xz -dc "$file" | pv -N "Extracting" >"$target"; then msg_error "Failed to extract $file" rm -f "$target" - exit 1 + exit 115 fi msg_ok "Decompressed to $target" } @@ -514,7 +514,7 @@ done < <(pvesm status -content images | awk 'NR>1 {printf "%s %s %s\n", $1, $2, if [ ${#STORAGE_MENU[@]} -eq 0 ]; then msg_error "Unable to detect a valid storage location." - exit 1 + exit 119 elif [ $((${#STORAGE_MENU[@]} / 3)) -eq 1 ]; then STORAGE=${STORAGE_MENU[0]} else