mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "1517bec1c3a21a9d401b0a0a4eb08ad08703e9bd" and "40ea76c0662d9c309c902283bd62011e43eb4447" have entirely different histories.
1517bec1c3
...
40ea76c066
|
@ -5,13 +5,6 @@
|
||||||
|
|
||||||
- All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
|
- All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
|
||||||
|
|
||||||
## 2023-10-08
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- **Proxmox VE LXC Updater**
|
|
||||||
- Now displays which containers require a reboot.
|
|
||||||
|
|
||||||
## 2023-10-05
|
## 2023-10-05
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -36,21 +36,6 @@ while read -r TAG ITEM; do
|
||||||
EXCLUDE_MENU+=("$TAG" "$ITEM " "OFF")
|
EXCLUDE_MENU+=("$TAG" "$ITEM " "OFF")
|
||||||
done < <(pct list | awk 'NR>1')
|
done < <(pct list | awk 'NR>1')
|
||||||
excluded_containers=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Containers on $NODE" --checklist "\nSelect containers to skip from updates:\n" 16 $((MSG_MAX_LENGTH + 23)) 6 "${EXCLUDE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
excluded_containers=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Containers on $NODE" --checklist "\nSelect containers to skip from updates:\n" 16 $((MSG_MAX_LENGTH + 23)) 6 "${EXCLUDE_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
|
||||||
|
|
||||||
function needs_reboot() {
|
|
||||||
local container=$1
|
|
||||||
local os=$(pct config "$container" | awk '/^ostype/ {print $2}')
|
|
||||||
local reboot_required_file="/var/run/reboot-required.pkgs"
|
|
||||||
if [ -f "$reboot_required_file" ]; then
|
|
||||||
if [[ "$os" == "ubuntu" || "$os" == "debian" ]]; then
|
|
||||||
if pct exec "$container" -- [ -s "$reboot_required_file" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function update_container() {
|
function update_container() {
|
||||||
container=$1
|
container=$1
|
||||||
header_info
|
header_info
|
||||||
|
@ -70,8 +55,6 @@ function update_container() {
|
||||||
ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update 2>/dev/null | grep 'packages.*upgraded'; apt list --upgradable && apt-get -y dist-upgrade" ;;
|
ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update 2>/dev/null | grep 'packages.*upgraded'; apt list --upgradable && apt-get -y dist-upgrade" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
containers_needing_reboot=()
|
|
||||||
header_info
|
header_info
|
||||||
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||||
if [[ " ${excluded_containers[@]} " =~ " $container " ]]; then
|
if [[ " ${excluded_containers[@]} " =~ " $container " ]]; then
|
||||||
|
@ -92,20 +75,8 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||||
elif [ "$status" == "status: running" ]; then
|
elif [ "$status" == "status: running" ]; then
|
||||||
update_container $container
|
update_container $container
|
||||||
fi
|
fi
|
||||||
if pct exec "$container" -- [ -e "/var/run/reboot-required" ]; then
|
|
||||||
# Get the container's hostname and add it to the list
|
|
||||||
container_hostname=$(pct exec "$container" hostname)
|
|
||||||
containers_needing_reboot+=("$container ($container_hostname)")
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
wait
|
wait
|
||||||
header_info
|
header_info
|
||||||
echo -e "${GN}The process is complete, and the selected containers have been updated.${CL}\n"
|
echo -e "${GN} Finished, Selected Containers Updated. ${CL} \n"
|
||||||
if [ "${#containers_needing_reboot[@]}" -gt 0 ]; then
|
|
||||||
echo -e "${RD}The following containers require a reboot:${CL}"
|
|
||||||
for container_name in "${containers_needing_reboot[@]}"; do
|
|
||||||
echo "$container_name"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
echo ""
|
|
||||||
|
|
Loading…
Reference in New Issue