scaling_governor=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Current CPU Scaling Governor is set to $current_governor" --checklist "\nSelect the Scaling Governor to use:\n"16$((MSG_MAX_LENGTH +58))6"${GOVERNORS_MENU[@]}" 3>&1 1>&2 2>&3| tr -d '"')|| exit
echo -e "\nProxmox IP \033[36m$(hostname -I)\033[m"
echo"${scaling_governor}"| tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >/dev/null
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Current CPU Scaling Governor""\nCurrent CPU Scaling Governor has been set to $current_governor\n"1060
echo -e "Available CPU Scaling Governors\n\033[36m${available_governors}\033[m\n"
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CPU Scaling Governor" --menu "This will establish a crontab to maintain the CPU Scaling Governor configuration across reboots.\n \nSetup a crontab?"14682\
echo -e "Current CPU Scaling Governor\n\033[36m$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)\033[m\n"
"yes"" "\
options=""
"no"" " 3>&2 2>&1 1>&3)
i=1
for governor in $available_governors
case$CHOICE in
do
yes)
options+="** ${i}) \033[36m${governor}\033[m CPU Scaling Governor\n"
NEW_CRONTAB_COMMAND="(sleep 60 && echo \"$current_governor\" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor)"
((i=i+1))
EXISTING_CRONTAB=$(crontab -l 2>/dev/null)
done
if[[ -n "$EXISTING_CRONTAB"]];then
echo -e "${options}"
TEMP_CRONTAB_FILE=$(mktemp)
echo -e "\033[31mNOTE: Settings return to default after reboot\033[m\n"