From eb57929e56f32458f2be5f6a835947851b1fa238 Mon Sep 17 00:00:00 2001 From: tteckster Date: Fri, 9 Sep 2022 21:03:20 -0400 Subject: [PATCH] Update Kernel Clean to work with PBS --- misc/kernel-clean.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/misc/kernel-clean.sh b/misc/kernel-clean.sh index c804741a..212ad8e0 100644 --- a/misc/kernel-clean.sh +++ b/misc/kernel-clean.sh @@ -14,7 +14,6 @@ CM="${GN}✓${CL}" CROSS="${RD}✗${CL}" PARTY="🎉" current_kernel=$(uname -r) -pve=$(pveversion) while true; do read -p "This will Clean Unused Kernel Images, USE AT YOUR OWN RISK. Proceed(y/n)?" yn @@ -70,7 +69,9 @@ function edge_kernel() { 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}" + if [[ "$MODE" != "PBS" ]]; then + echo -e "${YW}PVE Version: ${BL}$(pveversion)\n${CL}" + fi if [[ "$current_kernel" == *"pve"* ]]; then if [[ "$latest_kernel" != *"$current_kernel"* ]]; then echo -e "${GN}Latest Kernel: $latest_kernel\n${CL}" @@ -120,4 +121,12 @@ msg_ok "Kernel Search Completed\n" fi } +if ! command -v pveversion >/dev/null 2>&1; then + echo -e " Switching to PBS mode" + MODE="PBS" + sleep 2 + else + MODE="PVE" +fi + check_root