mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-08 22:40:45 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c335941ebe | |||
| d6d5996837 | |||
| d4ab2d465f | |||
| 31666305dc | |||
| 84ba70bc1c | |||
| 2032fa8175 | |||
| d4de03f8e8 |
@@ -592,8 +592,21 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
- Immich: do not clone libjxl's testdata [@MickLesk](https://github.com/MickLesk) ([#18539](https://github.com/community-scripts/ProxmoxVE/pull/18539))
|
||||
- Databasus: build 3.65 and ship the verification agent [@MickLesk](https://github.com/MickLesk) ([#18500](https://github.com/community-scripts/ProxmoxVE/pull/18500))
|
||||
|
||||
### 💾 Core
|
||||
|
||||
- fix: a closed console no longer ends a running setup | ERR trap fixes | check VM ID before creating [@MickLesk](https://github.com/MickLesk) ([core#219](https://github.com/community-scripts/core/pull/219))
|
||||
|
||||
### 🧰 Tools
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- update-apps: keep the backup alive on a closed console, stop before restoring [@MickLesk](https://github.com/MickLesk) ([#18540](https://github.com/community-scripts/ProxmoxVE/pull/18540))
|
||||
- clean-lxcs: run with sh and keep going when one container fails [@MickLesk](https://github.com/MickLesk) ([#18538](https://github.com/community-scripts/ProxmoxVE/pull/18538))
|
||||
- update-lxcs: keep going when one container fails [@MickLesk](https://github.com/MickLesk) ([#18541](https://github.com/community-scripts/ProxmoxVE/pull/18541))
|
||||
|
||||
## 2026-11-07
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
+1
-1
@@ -419,7 +419,7 @@ function compile_libjxl() {
|
||||
$STD git clone https://github.com/libjxl/libjxl.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBJXL_REVISION"
|
||||
$STD git submodule update --init --recursive --depth 1 --recommend-shallow
|
||||
$STD git submodule update --init --recursive --depth 1 --recommend-shallow -- third_party
|
||||
mkdir build
|
||||
cd build
|
||||
$STD cmake \
|
||||
|
||||
@@ -222,7 +222,7 @@ LIBJXL_REVISION="$(jq -cr '.revision' "$BASE_DIR"/server/sources/libjxl.json)"
|
||||
$STD git clone https://github.com/libjxl/libjxl.git "$SOURCE"
|
||||
cd "$SOURCE"
|
||||
$STD git reset --hard "$LIBJXL_REVISION"
|
||||
$STD git submodule update --init --recursive --depth 1 --recommend-shallow
|
||||
$STD git submodule update --init --recursive --depth 1 --recommend-shallow -- third_party
|
||||
mkdir build
|
||||
cd build
|
||||
$STD cmake \
|
||||
|
||||
@@ -282,7 +282,7 @@ function failure_reason() {
|
||||
function backup_container() {
|
||||
msg_info "Creating backup for container $1"
|
||||
local output
|
||||
if output=$(vzdump $1 --compress zstd --storage $STORAGE_CHOICE -notes-template "{{guestname}} - community-scripts backup updater" 2>&1); then
|
||||
if output=$(_cs_shield_hangup vzdump $1 --compress zstd --storage $STORAGE_CHOICE -notes-template "{{guestname}} - community-scripts backup updater" 2>&1); then
|
||||
msg_ok "Backup created"
|
||||
else
|
||||
log_write "Container $1: vzdump failed:"$'\n'"$output"
|
||||
@@ -651,7 +651,18 @@ for container in $CHOICE; do
|
||||
msg_error "Update failed for container $container ($service, exit code: $exit_code) — attempting restore"
|
||||
log_write "Container $container ($service): FAILED (exit $exit_code) — attempting restore"
|
||||
msg_info "Restoring LXC $container from backup ($STORAGE_CHOICE)"
|
||||
pct stop $container
|
||||
wait
|
||||
pct stop $container &>/dev/null || true
|
||||
for _ in {1..30}; do
|
||||
[[ "$(pct status $container 2>/dev/null)" == "status: stopped" ]] && break
|
||||
sleep 1
|
||||
done
|
||||
if [[ "$(pct status $container 2>/dev/null)" != "status: stopped" ]]; then
|
||||
msg_error "Container $container did not stop, so it cannot be restored"
|
||||
log_result "$container" "$service" "FAILED" "Update failed (exit $exit_code) — container did not stop for the restore"
|
||||
log_write "Container $container ($service): FAILED — container did not stop for the restore"
|
||||
exit 235
|
||||
fi
|
||||
LXC_STORAGE=$(pct config $container | awk -F '[:,]' '/rootfs/ {print $2}')
|
||||
BACKUP_ENTRY=$(pvesm list "$STORAGE_CHOICE" 2>/dev/null | awk -v ctid="$container" '$1 ~ "vzdump-lxc-"ctid"-" || $1 ~ "/ct/"ctid"/" {print $1}' | sort -r | head -n1)
|
||||
if [ -z "$BACKUP_ENTRY" ]; then
|
||||
|
||||
@@ -84,6 +84,7 @@ function update_container() {
|
||||
}
|
||||
|
||||
containers_needing_reboot=()
|
||||
failed_containers=()
|
||||
header_info
|
||||
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||
if [[ " ${excluded_containers[@]} " =~ " $container " ]]; then
|
||||
@@ -101,14 +102,17 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
|
||||
if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
|
||||
echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
|
||||
pct start $container
|
||||
if ! pct start $container; then
|
||||
failed_containers+=("$container (start)")
|
||||
continue
|
||||
fi
|
||||
echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"
|
||||
sleep 5
|
||||
update_container $container
|
||||
update_container $container || failed_containers+=("$container")
|
||||
echo -e "${BL}[Info]${GN} Shutting down${BL} $container ${CL} \n"
|
||||
pct shutdown $container &
|
||||
elif [ "$status" == "status: running" ]; then
|
||||
update_container $container
|
||||
update_container $container || failed_containers+=("$container")
|
||||
fi
|
||||
if [ "$status" == "status: running" ]; then
|
||||
if pct exec "$container" -- [ -e "/var/run/reboot-required" ]; then
|
||||
@@ -119,14 +123,20 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||
# check if patchmon agent is present in container and run a report if found
|
||||
if pct exec "$container" -- [ -e "/usr/local/bin/patchmon-agent" ]; then
|
||||
echo -e "${BL}[Info]${GN} patchmon-agent found in ${BL} $container ${CL}, triggering report. \n"
|
||||
pct exec "$container" -- "/usr/local/bin/patchmon-agent" "report"
|
||||
pct exec "$container" -- "/usr/local/bin/patchmon-agent" "report" || echo -e "${YW}[Warn]${CL} patchmon-agent report failed in $container\n"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
wait
|
||||
header_info
|
||||
echo -e "${GN}The process is complete, and the containers have been successfully updated.${CL}\n"
|
||||
if [ "${#failed_containers[@]}" -gt 0 ]; then
|
||||
echo -e "${RD}The update failed in these containers:${CL}"
|
||||
printf '%s\n' "${failed_containers[@]}"
|
||||
echo ""
|
||||
else
|
||||
echo -e "${GN}The process is complete, and the containers have been successfully updated.${CL}\n"
|
||||
fi
|
||||
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
|
||||
@@ -134,3 +144,4 @@ if [ "${#containers_needing_reboot[@]}" -gt 0 ]; then
|
||||
done
|
||||
fi
|
||||
echo ""
|
||||
[ "${#failed_containers[@]}" -eq 0 ] || exit 1
|
||||
|
||||
Reference in New Issue
Block a user