mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-08-13 16:32:23 +00:00
Update update-pve8.sh
This commit is contained in:
parent
ed36d9e953
commit
33d63457b3
@ -178,17 +178,64 @@ EOF
|
|||||||
msg_ok "$(translate "Conflicting utilities removed")"
|
msg_ok "$(translate "Conflicting utilities removed")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "$(translate "Performing system upgrade...")"
|
|
||||||
if DEBIAN_FRONTEND=noninteractive apt-get -y \
|
|
||||||
-o Dpkg::Options::='--force-confdef' \
|
|
||||||
-o Dpkg::Options::='--force-confold' \
|
|
||||||
dist-upgrade >> "$log_file" 2>&1; then
|
|
||||||
msg_ok "$(translate "System upgrade completed successfully")"
|
msg_info "$(translate "Performing packages upgrade...")"
|
||||||
else
|
apt-get install pv -y > /dev/null 2>&1
|
||||||
msg_error "$(translate "System upgrade failed. Check log: $log_file")"
|
total_packages=$(apt-get -s dist-upgrade | grep "^Inst" | wc -l)
|
||||||
return 1
|
msg_ok "$(translate "Packages upgrade successfull")"
|
||||||
|
|
||||||
|
if [ "$total_packages" -eq 0 ]; then
|
||||||
|
total_packages=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
tput civis
|
||||||
|
tput sc
|
||||||
|
|
||||||
|
|
||||||
|
(
|
||||||
|
/usr/bin/env DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::='--force-confdef' dist-upgrade 2>&1 | \
|
||||||
|
while IFS= read -r line; do
|
||||||
|
if [[ "$line" =~ ^(Setting up|Unpacking|Preparing to unpack|Processing triggers for) ]]; then
|
||||||
|
|
||||||
|
package_name=$(echo "$line" | sed -E 's/.*(Setting up|Unpacking|Preparing to unpack|Processing triggers for) ([^ ]+).*/\2/')
|
||||||
|
|
||||||
|
|
||||||
|
[ -z "$package_name" ] && package_name="$(translate "Unknown")"
|
||||||
|
|
||||||
|
|
||||||
|
tput rc
|
||||||
|
tput ed
|
||||||
|
|
||||||
|
|
||||||
|
row=$(( $(tput lines) - 6 ))
|
||||||
|
tput cup $row 0; echo "$(translate "Installing packages...")"
|
||||||
|
tput cup $((row + 1)) 0; echo "──────────────────────────────────────────────"
|
||||||
|
tput cup $((row + 2)) 0; echo "Package: $package_name"
|
||||||
|
tput cup $((row + 3)) 0; echo "Progress: [ ] 0%"
|
||||||
|
tput cup $((row + 4)) 0; echo "──────────────────────────────────────────────"
|
||||||
|
|
||||||
|
|
||||||
|
for i in $(seq 1 10); do
|
||||||
|
progress=$((i * 10))
|
||||||
|
tput cup $((row + 3)) 9
|
||||||
|
printf "[%-50s] %3d%%" "$(printf "#%.0s" $(seq 1 $((progress/2))))" "$progress"
|
||||||
|
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
tput rc
|
||||||
|
tput ed
|
||||||
|
msg_ok "$(translate "System upgrade completed")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local essential_packages=("zfsutils-linux" "proxmox-backup-restore-image" "chrony")
|
local essential_packages=("zfsutils-linux" "proxmox-backup-restore-image" "chrony")
|
||||||
local missing_packages=()
|
local missing_packages=()
|
||||||
@ -218,11 +265,13 @@ EOF
|
|||||||
local minutes=$((duration / 60))
|
local minutes=$((duration / 60))
|
||||||
local seconds=$((duration % 60))
|
local seconds=$((duration % 60))
|
||||||
|
|
||||||
echo -e "${TAB}${BGN}$(translate "=== PVE 8 UPDATE COMPLETED ===")${CL}"
|
echo -e "${TAB}${BGN}$(translate "====== PVE UPDATE COMPLETED ======")${CL}"
|
||||||
echo -e "${TAB}${GN}$(translate "Duration")${CL}: ${DGN}${minutes}m ${seconds}s${CL}"
|
echo -e "${TAB}${GN}⏱️ $(translate "Duration")${CL}: ${BL}${minutes}m ${seconds}s${CL}"
|
||||||
echo -e "${TAB}${GN}$(translate "Log file")${CL}: ${DGN}$log_file${CL}"
|
echo -e "${TAB}${GN}📄 $(translate "Log file")${CL}: ${BL}$log_file${CL}"
|
||||||
echo -e "${TAB}${GN}$(translate "Packages upgraded")${CL}: ${DGN}$upgradable${CL}"
|
echo -e "${TAB}${GN}📦 $(translate "Packages upgraded")${CL}: ${BL}$upgradable${CL}"
|
||||||
echo -e "${TAB}${GN}$(translate "Proxmox VE")${CL}: ${DGN}8.x (Debian $OS_CODENAME)${CL}"
|
echo -e "${TAB}${GN}🖥️ $(translate "Proxmox VE")${CL}: ${BL}$target_version (Debian $OS_CODENAME)${CL}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
msg_ok "$(translate "Proxmox VE 8 system update completed successfully")"
|
msg_ok "$(translate "Proxmox VE 8 system update completed successfully")"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user