mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-25 18:04:58 +02:00
Compare commits
1 Commits
github-act
...
github-act
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
970b71d61d |
33
CHANGELOG.md
33
CHANGELOG.md
@@ -467,39 +467,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## 2026-05-25
|
|
||||||
|
|
||||||
### 🚀 Updated Scripts
|
|
||||||
|
|
||||||
- #### 🐞 Bug Fixes
|
|
||||||
|
|
||||||
- karakeep: fix: pip config [@CrazyWolf13](https://github.com/CrazyWolf13) ([#14703](https://github.com/community-scripts/ProxmoxVE/pull/14703))
|
|
||||||
|
|
||||||
### 💾 Core
|
|
||||||
|
|
||||||
- #### ✨ New Features
|
|
||||||
|
|
||||||
- tools.func: replace raw GitHub API curl calls with get_latest_github_release [@MickLesk](https://github.com/MickLesk) ([#14690](https://github.com/community-scripts/ProxmoxVE/pull/14690))
|
|
||||||
|
|
||||||
### 🧰 Tools
|
|
||||||
|
|
||||||
- #### 🔧 Refactor
|
|
||||||
|
|
||||||
- Kernel-Clean: detect meta-packages and fix silent removal failures [@MickLesk](https://github.com/MickLesk) ([#14674](https://github.com/community-scripts/ProxmoxVE/pull/14674))
|
|
||||||
|
|
||||||
## 2026-05-24
|
|
||||||
|
|
||||||
### 🚀 Updated Scripts
|
|
||||||
|
|
||||||
- #### ✨ New Features
|
|
||||||
|
|
||||||
- RomM: add installation steps for Nginx mod_zip module [@MickLesk](https://github.com/MickLesk) ([#14678](https://github.com/community-scripts/ProxmoxVE/pull/14678))
|
|
||||||
- ISponsorblockTV: detect CPU capabilities to select compatible binary [@MickLesk](https://github.com/MickLesk) ([#14677](https://github.com/community-scripts/ProxmoxVE/pull/14677))
|
|
||||||
|
|
||||||
- #### 🔧 Refactor
|
|
||||||
|
|
||||||
- Refactor: MQTT [@tremor021](https://github.com/tremor021) ([#14673](https://github.com/community-scripts/ProxmoxVE/pull/14673))
|
|
||||||
|
|
||||||
## 2026-05-23
|
## 2026-05-23
|
||||||
|
|
||||||
### 🚀 Updated Scripts
|
### 🚀 Updated Scripts
|
||||||
|
|||||||
@@ -36,11 +36,7 @@ function update_script() {
|
|||||||
systemctl stop isponsorblocktv
|
systemctl stop isponsorblocktv
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
ISBTV_BINARY="iSponsorBlockTV-x86_64-linux-v1"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV" "singlefile" "latest" "/opt/isponsorblocktv" "iSponsorBlockTV-x86_64-linux"
|
||||||
if grep -q ' avx ' /proc/cpuinfo 2>/dev/null && grep -q ' avx2 ' /proc/cpuinfo 2>/dev/null && grep -q ' movbe ' /proc/cpuinfo 2>/dev/null; then
|
|
||||||
ISBTV_BINARY="iSponsorBlockTV-x86_64-linux"
|
|
||||||
fi
|
|
||||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV" "singlefile" "latest" "/opt/isponsorblocktv" "${ISBTV_BINARY}"
|
|
||||||
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start isponsorblocktv
|
systemctl start isponsorblocktv
|
||||||
|
|||||||
@@ -46,14 +46,6 @@ function update_script() {
|
|||||||
fi
|
fi
|
||||||
msg_ok "Update prepared"
|
msg_ok "Update prepared"
|
||||||
|
|
||||||
if [ ! -f ~/.config/pip/pip.conf ]; then
|
|
||||||
mkdir -p ~/.config/pip
|
|
||||||
cat <<EOF >~/.config/pip/pip.conf
|
|
||||||
[global]
|
|
||||||
break-system-packages = true
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
if grep -q "start:prod" /etc/systemd/system/karakeep-workers.service; then
|
if grep -q "start:prod" /etc/systemd/system/karakeep-workers.service; then
|
||||||
sed -i 's|^ExecStart=.*$|ExecStart=/usr/bin/node dist/index.mjs|' /etc/systemd/system/karakeep-workers.service
|
sed -i 's|^ExecStart=.*$|ExecStart=/usr/bin/node dist/index.mjs|' /etc/systemd/system/karakeep-workers.service
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|||||||
32
ct/mqtt.sh
32
ct/mqtt.sh
@@ -21,28 +21,18 @@ color
|
|||||||
catch_errors
|
catch_errors
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
if [[ ! -f /etc/mosquitto/conf.d/default.conf ]]; then
|
||||||
if [[ ! -f /etc/mosquitto/conf.d/default.conf ]]; then
|
msg_error "No ${APP} Installation Found!"
|
||||||
msg_error "No ${APP} Installation Found!"
|
exit
|
||||||
|
fi
|
||||||
|
msg_info "Updating ${APP} LXC"
|
||||||
|
$STD apt update
|
||||||
|
$STD apt -y upgrade
|
||||||
|
msg_ok "Updated successfully!"
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -f /etc/apt/sources.list.d/mqtt.sources ]]; then
|
|
||||||
setup_deb822_repo \
|
|
||||||
"mqtt" \
|
|
||||||
"https://repo.mosquitto.org/debian/mosquitto-repo.gpg" \
|
|
||||||
"https://repo.mosquitto.org/debian" \
|
|
||||||
"trixie"
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_info "Updating MQTT"
|
|
||||||
$STD apt update
|
|
||||||
$STD apt upgrade -y
|
|
||||||
msg_ok "Updated successfully!"
|
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
ISBTV_BINARY="iSponsorBlockTV-x86_64-linux-v1"
|
if ! grep -q ' avx ' /proc/cpuinfo 2>/dev/null; then
|
||||||
if grep -q ' avx ' /proc/cpuinfo 2>/dev/null && grep -q ' avx2 ' /proc/cpuinfo 2>/dev/null && grep -q ' movbe ' /proc/cpuinfo 2>/dev/null; then
|
msg_error "CPU does not support AVX instructions (required by iSponsorBlockTV/PyApp)"
|
||||||
ISBTV_BINARY="iSponsorBlockTV-x86_64-linux"
|
exit 106
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV" "singlefile" "latest" "/opt/isponsorblocktv" "${ISBTV_BINARY}"
|
fetch_and_deploy_gh_release "isponsorblocktv" "dmunozv04/iSponsorBlockTV" "singlefile" "latest" "/opt/isponsorblocktv" "iSponsorBlockTV-x86_64-linux"
|
||||||
|
|
||||||
msg_info "Setting up iSponsorBlockTV"
|
msg_info "Setting up iSponsorBlockTV"
|
||||||
install -d /var/lib/isponsorblocktv
|
install -d /var/lib/isponsorblocktv
|
||||||
|
|||||||
@@ -36,11 +36,6 @@ NODE_VERSION="24" NODE_MODULE="pnpm@${MODULE_VERSION}" setup_nodejs
|
|||||||
|
|
||||||
msg_info "Installing external JavaScript Extension for yt-dlp"
|
msg_info "Installing external JavaScript Extension for yt-dlp"
|
||||||
$STD pip install -U yt-dlp-ejs
|
$STD pip install -U yt-dlp-ejs
|
||||||
mkdir -p ~/.config/pip
|
|
||||||
cat <<EOF >~/.config/pip/pip.conf
|
|
||||||
[global]
|
|
||||||
break-system-packages = true
|
|
||||||
EOF
|
|
||||||
msg_ok "Installed external JavaScript Extension for yt-dlp"
|
msg_ok "Installed external JavaScript Extension for yt-dlp"
|
||||||
|
|
||||||
msg_info "Installing karakeep"
|
msg_info "Installing karakeep"
|
||||||
|
|||||||
@@ -13,26 +13,18 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
setup_deb822_repo \
|
|
||||||
"mqtt" \
|
|
||||||
"https://repo.mosquitto.org/debian/mosquitto-repo.gpg" \
|
|
||||||
"https://repo.mosquitto.org/debian" \
|
|
||||||
"trixie"
|
|
||||||
|
|
||||||
msg_info "Installing Mosquitto MQTT Broker"
|
msg_info "Installing Mosquitto MQTT Broker"
|
||||||
$STD apt install -y \
|
source /etc/os-release
|
||||||
mosquitto \
|
$STD apt update
|
||||||
mosquitto-clients
|
$STD apt -y install mosquitto mosquitto-clients
|
||||||
msg_ok "Installed Mosquitto MQTT Broker"
|
|
||||||
|
|
||||||
msg_info "Configuring Mosquitto MQTT Broker"
|
|
||||||
cat <<EOF >/etc/mosquitto/conf.d/default.conf
|
cat <<EOF >/etc/mosquitto/conf.d/default.conf
|
||||||
allow_anonymous false
|
allow_anonymous false
|
||||||
persistence true
|
persistence true
|
||||||
password_file /etc/mosquitto/passwd
|
password_file /etc/mosquitto/passwd
|
||||||
listener 1883
|
listener 1883
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Configured Mosquitto MQTT Broker"
|
msg_ok "Installed Mosquitto MQTT Broker"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|||||||
@@ -41,16 +41,6 @@ $STD apt install -y \
|
|||||||
nginx
|
nginx
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing Nginx mod_zip module"
|
|
||||||
setup_deb822_repo \
|
|
||||||
"getpagespeed-extras" \
|
|
||||||
"https://extras.getpagespeed.com/deb-archive-keyring.gpg" \
|
|
||||||
"https://extras.getpagespeed.com/debian" \
|
|
||||||
"$(get_os_info codename)" \
|
|
||||||
"main"
|
|
||||||
$STD apt-get install -y nginx nginx-module-zip
|
|
||||||
msg_ok "Installed Nginx mod_zip module"
|
|
||||||
|
|
||||||
PYTHON_VERSION="3.13" setup_uv
|
PYTHON_VERSION="3.13" setup_uv
|
||||||
NODE_VERSION="24" setup_nodejs
|
NODE_VERSION="24" setup_nodejs
|
||||||
setup_mariadb
|
setup_mariadb
|
||||||
|
|||||||
@@ -4269,10 +4269,12 @@ function setup_gs() {
|
|||||||
|
|
||||||
ensure_dependencies jq
|
ensure_dependencies jq
|
||||||
|
|
||||||
local LATEST_VERSION
|
local RELEASE_JSON
|
||||||
# Tags are "gs10.05.1" format — fetch without stripping "v", then strip "gs"
|
RELEASE_JSON=$(curl -fsSL --max-time 15 https://api.github.com/repos/ArtifexSoftware/ghostpdl-downloads/releases/latest 2>/dev/null || echo "")
|
||||||
LATEST_VERSION=$(get_latest_github_release "ArtifexSoftware/ghostpdl-downloads" "false") || {
|
|
||||||
|
if [[ -z "$RELEASE_JSON" ]]; then
|
||||||
msg_warn "Cannot fetch latest Ghostscript version from GitHub API"
|
msg_warn "Cannot fetch latest Ghostscript version from GitHub API"
|
||||||
|
# Try to get from current version
|
||||||
if command -v gs &>/dev/null; then
|
if command -v gs &>/dev/null; then
|
||||||
gs --version | head -n1
|
gs --version | head -n1
|
||||||
cache_installed_version "ghostscript" "$CURRENT_VERSION"
|
cache_installed_version "ghostscript" "$CURRENT_VERSION"
|
||||||
@@ -4280,9 +4282,11 @@ function setup_gs() {
|
|||||||
fi
|
fi
|
||||||
msg_error "Cannot determine Ghostscript version and no existing installation found"
|
msg_error "Cannot determine Ghostscript version and no existing installation found"
|
||||||
return 250
|
return 250
|
||||||
}
|
fi
|
||||||
LATEST_VERSION="${LATEST_VERSION#gs}"
|
local LATEST_VERSION
|
||||||
local LATEST_VERSION_DOTTED="$LATEST_VERSION"
|
LATEST_VERSION=$(echo "$RELEASE_JSON" | jq -r '.tag_name' | sed 's/^gs//')
|
||||||
|
local LATEST_VERSION_DOTTED
|
||||||
|
LATEST_VERSION_DOTTED=$(echo "$RELEASE_JSON" | jq -r '.name' | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
|
||||||
|
|
||||||
if [[ -z "$LATEST_VERSION" || -z "$LATEST_VERSION_DOTTED" ]]; then
|
if [[ -z "$LATEST_VERSION" || -z "$LATEST_VERSION_DOTTED" ]]; then
|
||||||
msg_warn "Could not determine latest Ghostscript version from GitHub - checking system"
|
msg_warn "Could not determine latest Ghostscript version from GitHub - checking system"
|
||||||
@@ -7332,11 +7336,22 @@ function setup_ruby() {
|
|||||||
# Download and build rbenv if needed
|
# Download and build rbenv if needed
|
||||||
if [[ ! -x "$RBENV_BIN" ]]; then
|
if [[ ! -x "$RBENV_BIN" ]]; then
|
||||||
local RBENV_RELEASE
|
local RBENV_RELEASE
|
||||||
RBENV_RELEASE=$(get_latest_github_release "rbenv/rbenv") || {
|
local rbenv_json
|
||||||
|
rbenv_json=$(curl -fsSL --max-time 15 https://api.github.com/repos/rbenv/rbenv/releases/latest 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
if [[ -z "$rbenv_json" ]]; then
|
||||||
msg_error "Failed to fetch latest rbenv version from GitHub"
|
msg_error "Failed to fetch latest rbenv version from GitHub"
|
||||||
rm -rf "$TMP_DIR"
|
rm -rf "$TMP_DIR"
|
||||||
return 7
|
return 7
|
||||||
}
|
fi
|
||||||
|
|
||||||
|
RBENV_RELEASE=$(echo "$rbenv_json" | jq -r '.tag_name' 2>/dev/null | sed 's/^v//' || echo "")
|
||||||
|
|
||||||
|
if [[ -z "$RBENV_RELEASE" ]]; then
|
||||||
|
msg_error "Could not parse rbenv version from GitHub response"
|
||||||
|
rm -rf "$TMP_DIR"
|
||||||
|
return 250
|
||||||
|
fi
|
||||||
|
|
||||||
if ! curl_with_retry "https://github.com/rbenv/rbenv/archive/refs/tags/v${RBENV_RELEASE}.tar.gz" "$TMP_DIR/rbenv.tar.gz"; then
|
if ! curl_with_retry "https://github.com/rbenv/rbenv/archive/refs/tags/v${RBENV_RELEASE}.tar.gz" "$TMP_DIR/rbenv.tar.gz"; then
|
||||||
msg_error "Failed to download rbenv"
|
msg_error "Failed to download rbenv"
|
||||||
@@ -7368,11 +7383,22 @@ function setup_ruby() {
|
|||||||
# Install ruby-build plugin
|
# Install ruby-build plugin
|
||||||
if [[ ! -d "$RBENV_DIR/plugins/ruby-build" ]]; then
|
if [[ ! -d "$RBENV_DIR/plugins/ruby-build" ]]; then
|
||||||
local RUBY_BUILD_RELEASE
|
local RUBY_BUILD_RELEASE
|
||||||
RUBY_BUILD_RELEASE=$(get_latest_github_release "rbenv/ruby-build") || {
|
local ruby_build_json
|
||||||
|
ruby_build_json=$(curl -fsSL --max-time 15 https://api.github.com/repos/rbenv/ruby-build/releases/latest 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
if [[ -z "$ruby_build_json" ]]; then
|
||||||
msg_error "Failed to fetch latest ruby-build version from GitHub"
|
msg_error "Failed to fetch latest ruby-build version from GitHub"
|
||||||
rm -rf "$TMP_DIR"
|
rm -rf "$TMP_DIR"
|
||||||
return 7
|
return 7
|
||||||
}
|
fi
|
||||||
|
|
||||||
|
RUBY_BUILD_RELEASE=$(echo "$ruby_build_json" | jq -r '.tag_name' 2>/dev/null | sed 's/^v//' || echo "")
|
||||||
|
|
||||||
|
if [[ -z "$RUBY_BUILD_RELEASE" ]]; then
|
||||||
|
msg_error "Could not parse ruby-build version from GitHub response"
|
||||||
|
rm -rf "$TMP_DIR"
|
||||||
|
return 250
|
||||||
|
fi
|
||||||
|
|
||||||
if ! curl_with_retry "https://github.com/rbenv/ruby-build/archive/refs/tags/v${RUBY_BUILD_RELEASE}.tar.gz" "$TMP_DIR/ruby-build.tar.gz"; then
|
if ! curl_with_retry "https://github.com/rbenv/ruby-build/archive/refs/tags/v${RUBY_BUILD_RELEASE}.tar.gz" "$TMP_DIR/ruby-build.tar.gz"; then
|
||||||
msg_error "Failed to download ruby-build"
|
msg_error "Failed to download ruby-build"
|
||||||
@@ -7755,7 +7781,8 @@ function setup_clickhouse() {
|
|||||||
|
|
||||||
# Fallback to GitHub API if package server failed
|
# Fallback to GitHub API if package server failed
|
||||||
if [[ -z "$CLICKHOUSE_VERSION" ]]; then
|
if [[ -z "$CLICKHOUSE_VERSION" ]]; then
|
||||||
CLICKHOUSE_VERSION=$(get_latest_github_release "ClickHouse/ClickHouse") || true
|
CLICKHOUSE_VERSION=$(curl -fsSL --max-time 15 https://api.github.com/repos/ClickHouse/ClickHouse/releases/latest 2>/dev/null |
|
||||||
|
grep -oP '"tag_name":\s*"v\K[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n1 || echo "")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -z "$CLICKHOUSE_VERSION" ]] && {
|
[[ -z "$CLICKHOUSE_VERSION" ]] && {
|
||||||
@@ -8044,11 +8071,22 @@ function setup_uv() {
|
|||||||
ensure_dependencies jq
|
ensure_dependencies jq
|
||||||
|
|
||||||
# Fetch latest version
|
# Fetch latest version
|
||||||
local LATEST_VERSION
|
local releases_json
|
||||||
LATEST_VERSION=$(get_latest_github_release "astral-sh/uv") || {
|
releases_json=$(curl -fsSL --max-time 15 \
|
||||||
|
"https://api.github.com/repos/astral-sh/uv/releases/latest" 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
if [[ -z "$releases_json" ]]; then
|
||||||
msg_error "Could not fetch latest uv version from GitHub API"
|
msg_error "Could not fetch latest uv version from GitHub API"
|
||||||
return 7
|
return 7
|
||||||
}
|
fi
|
||||||
|
|
||||||
|
local LATEST_VERSION
|
||||||
|
LATEST_VERSION=$(echo "$releases_json" | jq -r '.tag_name' 2>/dev/null | sed 's/^v//')
|
||||||
|
|
||||||
|
if [[ -z "$LATEST_VERSION" ]]; then
|
||||||
|
msg_error "Could not parse uv version from GitHub API response"
|
||||||
|
return 250
|
||||||
|
fi
|
||||||
|
|
||||||
# Get currently installed version
|
# Get currently installed version
|
||||||
local INSTALLED_VERSION=""
|
local INSTALLED_VERSION=""
|
||||||
@@ -8175,11 +8213,22 @@ function setup_yq() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local LATEST_VERSION
|
local LATEST_VERSION
|
||||||
LATEST_VERSION=$(get_latest_github_release "${GITHUB_REPO}") || {
|
local releases_json
|
||||||
|
releases_json=$(curl -fsSL --max-time 15 "https://api.github.com/repos/${GITHUB_REPO}/releases/latest" 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
if [[ -z "$releases_json" ]]; then
|
||||||
msg_error "Could not fetch latest yq version from GitHub API"
|
msg_error "Could not fetch latest yq version from GitHub API"
|
||||||
rm -rf "$TMP_DIR"
|
rm -rf "$TMP_DIR"
|
||||||
return 250
|
return 250
|
||||||
}
|
fi
|
||||||
|
|
||||||
|
LATEST_VERSION=$(echo "$releases_json" | jq -r '.tag_name' 2>/dev/null | sed 's/^v//' || echo "")
|
||||||
|
|
||||||
|
if [[ -z "$LATEST_VERSION" ]]; then
|
||||||
|
msg_error "Could not parse yq version from GitHub API response"
|
||||||
|
rm -rf "$TMP_DIR"
|
||||||
|
return 250
|
||||||
|
fi
|
||||||
|
|
||||||
# Get currently installed version
|
# Get currently installed version
|
||||||
local INSTALLED_VERSION=""
|
local INSTALLED_VERSION=""
|
||||||
|
|||||||
@@ -28,14 +28,7 @@ declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "kernel-clean"
|
|||||||
|
|
||||||
# Detect current kernel
|
# Detect current kernel
|
||||||
current_kernel=$(uname -r)
|
current_kernel=$(uname -r)
|
||||||
# Only list fully-installed (ii) versioned kernel packages; the pattern
|
available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print $2}' | grep -v "$current_kernel" | sort -V)
|
||||||
# proxmox-kernel-X.Y.Z matches versioned kernels while excluding the
|
|
||||||
# two-segment meta-packages (proxmox-kernel-X.Y) and proxmox-kernel-helper.
|
|
||||||
available_kernels=$(dpkg --list |
|
|
||||||
awk '/^ii/ {print $2}' |
|
|
||||||
grep -E '^proxmox-kernel-[0-9]+\.[0-9]+\.[0-9]' |
|
|
||||||
grep -v "$current_kernel" |
|
|
||||||
sort -V)
|
|
||||||
|
|
||||||
header_info
|
header_info
|
||||||
|
|
||||||
@@ -89,28 +82,10 @@ fi
|
|||||||
# Remove kernels
|
# Remove kernels
|
||||||
for kernel in "${kernels_to_remove[@]}"; do
|
for kernel in "${kernels_to_remove[@]}"; do
|
||||||
echo -e "${YW}Removing $kernel...${CL}"
|
echo -e "${YW}Removing $kernel...${CL}"
|
||||||
# Derive the major.minor meta-package name (e.g. proxmox-kernel-6.14)
|
if apt-get purge -y "$kernel" >/dev/null 2>&1; then
|
||||||
# from a versioned name like proxmox-kernel-6.14.11-9-pve-signed.
|
echo -e "${GN}Successfully removed: $kernel${CL}"
|
||||||
minor_version=$(echo "$kernel" | sed -E 's/^proxmox-kernel-([0-9]+\.[0-9]+)\..*/\1/')
|
|
||||||
meta="proxmox-kernel-${minor_version}"
|
|
||||||
pkgs_to_remove=("$kernel")
|
|
||||||
# Include the meta-package in the purge when it is installed and when
|
|
||||||
# no other versioned kernel of the same minor version will remain
|
|
||||||
# (the running kernel keeps it alive if it shares the same minor).
|
|
||||||
if dpkg -l "$meta" 2>/dev/null | grep -q '^ii'; then
|
|
||||||
remaining=$(dpkg --list |
|
|
||||||
awk '/^ii/ {print $2}' |
|
|
||||||
grep -E "^proxmox-kernel-${minor_version}\." |
|
|
||||||
grep -v "^${kernel}$" |
|
|
||||||
wc -l)
|
|
||||||
if [ "$remaining" -eq 0 ]; then
|
|
||||||
pkgs_to_remove+=("$meta")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if apt-get purge -y "${pkgs_to_remove[@]}" >/dev/null 2>&1; then
|
|
||||||
echo -e "${GN}Successfully removed: ${pkgs_to_remove[*]}${CL}"
|
|
||||||
else
|
else
|
||||||
echo -e "${RD}Failed to remove: ${pkgs_to_remove[*]}. Check dependencies.${CL}"
|
echo -e "${RD}Failed to remove: $kernel. Check dependencies.${CL}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user