From 157ee78ed17c7b635b016180b655fe3d5cac1605 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 13 Jul 2022 12:56:23 -0400 Subject: [PATCH] Update kernel-clean-v3.sh --- misc/kernel-clean-v3.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/misc/kernel-clean-v3.sh b/misc/kernel-clean-v3.sh index 332cc7d8..9ef8c753 100644 --- a/misc/kernel-clean-v3.sh +++ b/misc/kernel-clean-v3.sh @@ -54,11 +54,20 @@ function check_root() { exit 1 else header_info + edge_kernel kernel_info kernel_clean 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() { latest_kernel=$(dpkg --list| grep 'kernel-.*-pve' | awk '{print $2}' | tac | head -n 1) echo -e "${YW}PVE Version: ${BL}$pve\n${CL}" @@ -67,7 +76,7 @@ function kernel_info() { echo -e "${GN}Latest Kernel: $latest_kernel\n${CL}" fi else - echo -e "\n${CROSS}${RD}ERROR: No PVE Kernel Found\n${CL}" + echo -e "\n${CROSS} ${RD}ERROR: No PVE Kernel Found\n${CL}" exit 1 fi }