read -p "This will Clean Unused Kernel Images, USE AT YOUR OWN RISK. Proceed(y/n)?" yn
case$yn in
[Yy]*)break;;
[Nn]*)exit;;
*)echo -e "${RD}Please answer y/n${CL}";;
esac
done
clear
function msg_info(){
localmsg="$1"
echo -ne "${HOLD}${YW}${msg}..."
localmsg="$1"
echo -ne "${HOLD}${YW}${msg}..."
}
function msg_ok(){
localmsg="$1"
echo -e "${BFR}${CM}${GN}${msg}${CL}"
localmsg="$1"
echo -e "${BFR}${CM}${GN}${msg}${CL}"
}
function check_root(){
if[[$EUID -ne 0]];then
echo -e "${CROSS}${RD}Error: This script must be ran as the root user.\n${CL}"
exit1
else
header_info
other_kernel
kernel_info
kernel_clean
fi
}
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE Kernel Clean" --yesno "This will Clean Unused Kernel Images, USE AT YOUR OWN RISK. Proceed?"1068|| exit
echo -e "\nThe script cannot be used when running opt-in kernels. \nProxmox VE's package management relies directly on the current default kernel, which is 5.15. \nTherefore, it is not possible to utilize this script. In this case, you should use autoremove instead. \n`apt-get autoremove`\n"
exit1
fi
fi
}
if[ -z "$available_kernels"];then
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Other Kernels" --msgbox "It appears there are no old Kernels on your system. \nCurrent kernel ($current_kernel)."1068
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Remove Kernels" --yesno "Would you like to remove the selected Kernels\n $remove_kernels\n Proceed?"1068|| exit