diff --git a/tools/pve/container-restore-from-backup.sh b/tools/pve/container-restore-from-backup.sh index c5d5a0841..c73d51c7d 100644 --- a/tools/pve/container-restore-from-backup.sh +++ b/tools/pve/container-restore-from-backup.sh @@ -62,7 +62,7 @@ function msg_error() { } if [ -z "$(ls -A /var/lib/docker/volumes/hass_config/_data/backups/)" ]; then msg_error "No backups found! \n" - exit 1 + exit 235 fi DIR=/var/lib/docker/volumes/hass_config/_data/restore if [ -d "$DIR" ]; then diff --git a/tools/pve/core-restore-from-backup.sh b/tools/pve/core-restore-from-backup.sh index 855767dae..276b7e122 100644 --- a/tools/pve/core-restore-from-backup.sh +++ b/tools/pve/core-restore-from-backup.sh @@ -62,7 +62,7 @@ function msg_error() { } if [ -z "$(ls -A /root/.homeassistant/backups/)" ]; then msg_error "No backups found! \n" - exit 1 + exit 235 fi DIR=/root/.homeassistant/restore if [ -d "$DIR" ]; then diff --git a/tools/pve/fstrim.sh b/tools/pve/fstrim.sh index 90e3aa236..8540aa457 100644 --- a/tools/pve/fstrim.sh +++ b/tools/pve/fstrim.sh @@ -39,7 +39,7 @@ ROOT_FS=$(df -Th "/" | awk 'NR==2 {print $2}') if [ "$ROOT_FS" != "ext4" ]; then whiptail --backtitle "Proxmox VE Helper Scripts" \ --title "Warning" \ - --yesno "Root filesystem is not ext4 ($ROOT_FS).\nContinue anyway?" 12 80 || exit 1 + --yesno "Root filesystem is not ext4 ($ROOT_FS).\nContinue anyway?" 12 80 || exit 0 fi NODE=$(hostname) diff --git a/tools/pve/kernel-clean.sh b/tools/pve/kernel-clean.sh index e8dd68848..a9af89219 100644 --- a/tools/pve/kernel-clean.sh +++ b/tools/pve/kernel-clean.sh @@ -57,7 +57,7 @@ done if [ ${#kernels_to_remove[@]} -eq 0 ]; then echo -e "${RD}No valid selection made. Exiting.${CL}" - exit 1 + exit 0 fi # Confirm removal @@ -66,7 +66,7 @@ printf "%s\n" "${kernels_to_remove[@]}" read -rp "Proceed with removal? (y/n): " confirm if [[ "$confirm" != "y" ]]; then echo -e "${RD}Aborted.${CL}" - exit 1 + exit 0 fi # Remove kernels diff --git a/tools/pve/lxc-delete.sh b/tools/pve/lxc-delete.sh index 8fb43af9b..9ff666d46 100644 --- a/tools/pve/lxc-delete.sh +++ b/tools/pve/lxc-delete.sh @@ -51,7 +51,7 @@ containers=$(pct list | tail -n +2 | awk '{print $0 " " $4}') if [ -z "$containers" ]; then whiptail --title "LXC Container Delete" --msgbox "No LXC containers available!" 10 60 - exit 1 + exit 234 fi menu_items=("ALL" "Delete ALL containers" "OFF") # Add as first option @@ -72,7 +72,7 @@ CHOICES=$(whiptail --title "LXC Container Delete" \ if [ -z "$CHOICES" ]; then whiptail --title "LXC Container Delete" \ --msgbox "No containers selected!" 10 60 - exit 1 + exit 0 fi read -p "Delete containers manually or automatically? (Default: manual) m/a: " DELETE_MODE diff --git a/tools/pve/nic-offloading-fix.sh b/tools/pve/nic-offloading-fix.sh index e22d0d669..ef630e536 100644 --- a/tools/pve/nic-offloading-fix.sh +++ b/tools/pve/nic-offloading-fix.sh @@ -47,7 +47,7 @@ function msg_warn() { echo -e "${WARN} ${YWB}${1}"; } # Check for root privileges if [ "$(id -u)" -ne 0 ]; then msg_error "Error: This script must be run as root." - exit 1 + exit 104 fi if ! command -v ethtool >/dev/null 2>&1; then @@ -55,7 +55,7 @@ if ! command -v ethtool >/dev/null 2>&1; then apt-get update &>/dev/null apt-get install -y ethtool &>/dev/null || { msg_error "Failed to install ethtool. Exiting." - exit 1 + exit 237 } msg_ok "ethtool installed successfully" fi @@ -86,7 +86,7 @@ done if [ ${#INTERFACES[@]} -eq 0 ]; then whiptail --title "Error" --msgbox "No Intel e1000e or e1000 network interfaces found!" 10 60 msg_error "No Intel e1000e or e1000 network interfaces found! Exiting." - exit 1 + exit 236 fi msg_ok "Found ${BL}$COUNT${GN} Intel e1000e/e1000 interfaces" diff --git a/tools/pve/pbs_microcode.sh b/tools/pve/pbs_microcode.sh index ccd47ffe4..e9cfd8bd5 100644 --- a/tools/pve/pbs_microcode.sh +++ b/tools/pve/pbs_microcode.sh @@ -41,7 +41,7 @@ header_info virt=$(systemd-detect-virt) if [ "$virt" != "none" ]; then msg_error "This script must be run on bare metal. Detected virtual environment: $virt" - exit 1 + exit 232 fi # Attempt to obtain the current loaded microcode revision diff --git a/tools/pve/post-pbs-install.sh b/tools/pve/post-pbs-install.sh index 3b21f37e4..47100948e 100644 --- a/tools/pve/post-pbs-install.sh +++ b/tools/pve/post-pbs-install.sh @@ -83,7 +83,7 @@ main() { if command -v pveversion >/dev/null 2>&1; then echo -e "\nšŸ›‘ PVE Detected, Wrong Script!\n" - exit 1 + exit 232 fi local CODENAME @@ -95,7 +95,7 @@ main() { *) msg_error "Unsupported Debian codename: $CODENAME" echo -e "Supported: bookworm (PBS 3.x) and trixie (PBS 4.x)" - exit 1 + exit 105 ;; esac } diff --git a/tools/pve/post-pmg-install.sh b/tools/pve/post-pmg-install.sh index 579e0b513..532c4efaa 100644 --- a/tools/pve/post-pmg-install.sh +++ b/tools/pve/post-pmg-install.sh @@ -49,7 +49,7 @@ declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "post-pmg-inst if ! grep -q "Proxmox Mail Gateway" /etc/issue 2>/dev/null; then msg_error "This script is only intended for Proxmox Mail Gateway" - exit 1 + exit 232 fi repo_state() {