Update kernel-clean-v3.sh

This commit is contained in:
tteckster 2022-07-13 12:56:23 -04:00 committed by GitHub
parent b00fbaff08
commit 157ee78ed1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,11 +54,20 @@ function check_root() {
exit 1 exit 1
else else
header_info header_info
edge_kernel
kernel_info kernel_info
kernel_clean kernel_clean
fi fi
} }
function edge_kernel() {
if [[ "$current_kernel" == *"edge"* ]]; then
echo -e "\n${CROSS} ${RD}ERROR:${CL} Proxmox ${BL}${current_kernel}${CL} Kernel Active"
echo -e "\nAn Active PVE Kernel is required to run Kernel Clean\n"
exit 1
fi
}
function kernel_info() { function kernel_info() {
latest_kernel=$(dpkg --list| grep 'kernel-.*-pve' | awk '{print $2}' | tac | head -n 1) latest_kernel=$(dpkg --list| grep 'kernel-.*-pve' | awk '{print $2}' | tac | head -n 1)
echo -e "${YW}PVE Version: ${BL}$pve\n${CL}" echo -e "${YW}PVE Version: ${BL}$pve\n${CL}"