Ostatnio aktywny 1750106906

Rewizja 7b63af846591f4cdfb69646b5538737cbd8943a3

update-pve.sh Surowy
1#!/bin/bash
2
3# Check for available updates
4echo "Checking for available updates..."
5apt update -qq
6UPGRADABLE=$(apt list --upgradable 2>/dev/null | grep -v "Listing..." | grep -v "^$")
7
8if [ -z "$UPGRADABLE" ]; then
9 echo "Proxmox VE is already up to date."
10 exit 0
11fi
12
13echo "Updating Proxmox VE (please wait)..."
14apt full-upgrade -y && apt autoremove -y && apt autoclean
15echo "Proxmox VE update complete."
16
17# Countdown before reboot
18COUNTDOWN=30
19echo "System will reboot in $COUNTDOWN seconds. Press Ctrl+C to cancel."
20while [ $COUNTDOWN -gt 0 ]; do
21 echo -ne "Rebooting in $COUNTDOWN seconds...\r"
22 sleep 1
23 COUNTDOWN=$((COUNTDOWN-1))
24done
25
26echo -e "\nRebooting now."
27reboot
28