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