mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-26 10:19:36 +02:00
Compare commits
2 Commits
fix/docuse
...
patch_kern
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
435835b210 | ||
|
|
77a4322623 |
@@ -42,13 +42,6 @@ function update_script() {
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "docuseal" "docusealco/docuseal" "tarball"
|
||||
|
||||
local required_ruby current_ruby
|
||||
required_ruby=$(grep -m1 '^ruby ' /opt/docuseal/Gemfile | grep -oP '[0-9]+\.[0-9]+\.[0-9]+')
|
||||
current_ruby=$(PATH="/root/.rbenv/bin:/root/.rbenv/shims:${PATH}" rbenv global 2>/dev/null || true)
|
||||
if [[ -n "$required_ruby" && "$required_ruby" != "$current_ruby" ]]; then
|
||||
RUBY_VERSION="${required_ruby}" RUBY_INSTALL_RAILS="false" HOME=/root setup_ruby
|
||||
fi
|
||||
|
||||
msg_info "Restoring Data"
|
||||
mv /opt/docuseal.env.bak /opt/docuseal/.env
|
||||
[[ -d /opt/docuseal_data.bak ]] && mv /opt/docuseal_data.bak /opt/docuseal/data
|
||||
|
||||
@@ -31,6 +31,7 @@ $STD apt install -y \
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
|
||||
RUBY_VERSION="4.0.1" RUBY_INSTALL_RAILS="false" HOME=/root setup_ruby
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="docuseal" PG_DB_USER="docuseal" setup_postgresql_db
|
||||
|
||||
@@ -55,9 +56,6 @@ msg_ok "Downloaded Fonts and PDFium"
|
||||
|
||||
fetch_and_deploy_gh_release "docuseal" "docusealco/docuseal" "tarball"
|
||||
|
||||
RUBY_VERSION=$(grep -m1 '^ruby ' /opt/docuseal/Gemfile | grep -oP '[0-9]+\.[0-9]+\.[0-9]+')
|
||||
RUBY_VERSION="${RUBY_VERSION}" RUBY_INSTALL_RAILS="false" HOME=/root setup_ruby
|
||||
|
||||
msg_info "Downloading Field Detection Model"
|
||||
mkdir -p /opt/docuseal/tmp
|
||||
curl -fsSL -o /opt/docuseal/tmp/model.onnx \
|
||||
|
||||
@@ -28,7 +28,14 @@ declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "kernel-clean"
|
||||
|
||||
# Detect current kernel
|
||||
current_kernel=$(uname -r)
|
||||
available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print $2}' | grep -v "$current_kernel" | sort -V)
|
||||
# Only list fully-installed (ii) versioned kernel packages; the pattern
|
||||
# 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
|
||||
|
||||
@@ -82,10 +89,28 @@ fi
|
||||
# Remove kernels
|
||||
for kernel in "${kernels_to_remove[@]}"; do
|
||||
echo -e "${YW}Removing $kernel...${CL}"
|
||||
if apt-get purge -y "$kernel" >/dev/null 2>&1; then
|
||||
echo -e "${GN}Successfully removed: $kernel${CL}"
|
||||
# Derive the major.minor meta-package name (e.g. proxmox-kernel-6.14)
|
||||
# from a versioned name like proxmox-kernel-6.14.11-9-pve-signed.
|
||||
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
|
||||
echo -e "${RD}Failed to remove: $kernel. Check dependencies.${CL}"
|
||||
echo -e "${RD}Failed to remove: ${pkgs_to_remove[*]}. Check dependencies.${CL}"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user