Update check_running_kernel

Add Proxmox 8.1 support
This commit is contained in:
Thorsten Spille 2023-12-11 22:43:44 +01:00 committed by GitHub
parent db23af03dd
commit 6cf7c6df72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,18 +32,22 @@ uname=$(uname -r)
major_version=${uname:0:3}
if [[ "$uname" == *"-pve" ]]; then
if [[ "$(lsb_release -cs 2> /dev/null)" == "bookworm" ]]; then
filter=proxmox-kernel-$major_version
if [[ "$major-version" == "6.5" ]]; then
filter="proxmox-kernel-${major_version}.*-signed"
else
filter=pve-kernel-$major_version
filter="proxmox-kernel-${major_version}"
fi
else
filter="pve-kernel-${major_version}"
fi
elif [[ "$uname" == *"-mvebu" ]]; then
latest_kernel=$(dpkg -l | grep -m1 linux-image-current-mvebu | rev | cut -d ' ' -f2 | rev)
else
filter=linux-image-$major_version
filter="linux-image-$major_version"
fi
if [[ "$uname" != *"-mvebu" ]]; then
latest_kernel=$(dpkg --get-selections | grep $filter | grep -E "\sinstall" | sort -V | tail -1 | cut -f1 | cut -d'-' -f3-)
latest_kernel=$(dpkg --get-selections | grep -E $filter | grep -E "\sinstall" | sort -V | tail -1 | cut -f1 | cut -d'-' -f3-)
fi
if [[ "$latest_kernel" == "$uname" ]]; then