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(){
function msg_info(){
localmsg="$1"
localmsg="$1"
echo -ne "${HOLD}${YW}${msg}..."
echo -ne "${HOLD}${YW}${msg}..."
}
}
function msg_ok(){
function msg_ok(){
localmsg="$1"
localmsg="$1"
echo -e "${BFR}${CM}${GN}${msg}${CL}"
echo -e "${BFR}${CM}${GN}${msg}${CL}"
}
}
function check_root(){
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
if[[$EUID -ne 0]];then
echo -e "${CROSS}${RD}Error: This script must be ran as the root user.\n${CL}"
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
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"
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