mirror of https://github.com/tteck/Proxmox.git
				
				
				
			
							parent
							
								
									8e331fcbff
								
							
						
					
					
						commit
						f777a968ea
					
				| 
						 | 
					@ -4,14 +4,14 @@ set -e
 | 
				
			||||||
while true; do
 | 
					while true; do
 | 
				
			||||||
    read -p "View CPU Scaling Governors. Proceed(y/n)?" yn
 | 
					    read -p "View CPU Scaling Governors. Proceed(y/n)?" yn
 | 
				
			||||||
    case $yn in
 | 
					    case $yn in
 | 
				
			||||||
    [Yy]*) break ;;
 | 
					        [Yy]* ) break;;
 | 
				
			||||||
    [Nn]*) exit ;;
 | 
					        [Nn]* ) exit;;
 | 
				
			||||||
    *) echo "Please answer yes or no." ;;
 | 
					        * ) echo "Please answer yes or no.";;
 | 
				
			||||||
    esac
 | 
					    esac
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
clear
 | 
					clear
 | 
				
			||||||
function header_info {
 | 
					function header_info {
 | 
				
			||||||
    echo -e "
 | 
					echo -e "
 | 
				
			||||||
   _____ _____  _    _ 
 | 
					   _____ _____  _    _ 
 | 
				
			||||||
  / ____|  __ \| |  | |
 | 
					  / ____|  __ \| |  | |
 | 
				
			||||||
 | |    | |__) | |  | |
 | 
					 | |    | |__) | |  | |
 | 
				
			||||||
| 
						 | 
					@ -21,16 +21,16 @@ function header_info {
 | 
				
			||||||
    Scaling Governors
 | 
					    Scaling Governors
 | 
				
			||||||
"
 | 
					"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
show_menu() {
 | 
					show_menu(){
 | 
				
			||||||
    CL=$(echo "\033[m")
 | 
					    CL=`echo "\033[m"`
 | 
				
			||||||
    GN=$(echo "\033[32m")
 | 
					    GN=`echo "\033[32m"`
 | 
				
			||||||
    BL=$(echo "\033[36m")
 | 
					    BL=`echo "\033[36m"`
 | 
				
			||||||
    YW=$(echo "\033[33m")
 | 
					    YW=`echo "\033[33m"`
 | 
				
			||||||
    fgred=$(echo "\033[31m")
 | 
					    fgred=`echo "\033[31m"`
 | 
				
			||||||
    header_info
 | 
					header_info
 | 
				
			||||||
    CK=$(uname -r)
 | 
					    CK=$(uname -r)
 | 
				
			||||||
    IP=$(hostname -I)
 | 
					    IP=$(hostname -I)
 | 
				
			||||||
    #    MAC=$(cat /sys/class/net/eno1/address)
 | 
					#    MAC=$(cat /sys/class/net/eno1/address)
 | 
				
			||||||
    ACSG=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)
 | 
					    ACSG=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)
 | 
				
			||||||
    CCSG=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
 | 
					    CCSG=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
 | 
				
			||||||
    echo -e "${YW}Proxmox IP ${BL}${IP}${CL}"
 | 
					    echo -e "${YW}Proxmox IP ${BL}${IP}${CL}"
 | 
				
			||||||
| 
						 | 
					@ -41,7 +41,7 @@ show_menu() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    echo -e "\n${YW}Available CPU Scaling Governors
 | 
					    echo -e "\n${YW}Available CPU Scaling Governors
 | 
				
			||||||
    ${BL}${ACSG}${CL}"
 | 
					    ${BL}${ACSG}${CL}"
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    echo -e "\n${YW}Current CPU Scaling Governor
 | 
					    echo -e "\n${YW}Current CPU Scaling Governor
 | 
				
			||||||
    ${BL}${CCSG}${CL}"
 | 
					    ${BL}${CCSG}${CL}"
 | 
				
			||||||
    printf "\n ${fgred}Only Select Available CPU Scaling Governors From Above${CL}\n \n"
 | 
					    printf "\n ${fgred}Only Select Available CPU Scaling Governors From Above${CL}\n \n"
 | 
				
			||||||
| 
						 | 
					@ -57,51 +57,43 @@ show_menu() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
clear
 | 
					clear
 | 
				
			||||||
show_menu
 | 
					show_menu
 | 
				
			||||||
while [ $opt != '' ]; do
 | 
					while [ $opt != '' ]
 | 
				
			||||||
 | 
					    do
 | 
				
			||||||
    if [ $opt = '' ]; then
 | 
					    if [ $opt = '' ]; then
 | 
				
			||||||
        exit
 | 
					      exit;
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        case $opt in
 | 
					      case $opt in
 | 
				
			||||||
        1)
 | 
					        1) echo "conservative" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
				
			||||||
            echo "conservative" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
					 | 
				
			||||||
            clear
 | 
					            clear
 | 
				
			||||||
            show_menu
 | 
					            show_menu
 | 
				
			||||||
            ;;
 | 
					        ;;
 | 
				
			||||||
        2)
 | 
					        2) echo "ondemand" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
				
			||||||
            echo "ondemand" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
					 | 
				
			||||||
            clear
 | 
					            clear
 | 
				
			||||||
            show_menu
 | 
					            show_menu
 | 
				
			||||||
            ;;
 | 
					        ;;
 | 
				
			||||||
        3)
 | 
					        3) echo "userspace" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
				
			||||||
            echo "userspace" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
					 | 
				
			||||||
            clear
 | 
					            clear
 | 
				
			||||||
            show_menu
 | 
					            show_menu
 | 
				
			||||||
            ;;
 | 
					        ;;
 | 
				
			||||||
        4)
 | 
					        4) echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
				
			||||||
            echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
					 | 
				
			||||||
            clear
 | 
					            clear
 | 
				
			||||||
            show_menu
 | 
					            show_menu
 | 
				
			||||||
            ;;
 | 
					        ;;
 | 
				
			||||||
        5)
 | 
					        5) echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
				
			||||||
            echo "performance" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
					 | 
				
			||||||
            clear
 | 
					            clear
 | 
				
			||||||
            show_menu
 | 
					            show_menu
 | 
				
			||||||
            ;;
 | 
					        ;;
 | 
				
			||||||
        6)
 | 
					        6) echo "schedutil" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
				
			||||||
            echo "schedutil" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 | 
					 | 
				
			||||||
            clear
 | 
					            clear
 | 
				
			||||||
            show_menu
 | 
					            show_menu
 | 
				
			||||||
            ;;
 | 
					        ;;
 | 
				
			||||||
        x)
 | 
					        x)exit;
 | 
				
			||||||
            exit
 | 
					        ;;
 | 
				
			||||||
            ;;
 | 
					        \n)exit;
 | 
				
			||||||
        \n)
 | 
					        ;;
 | 
				
			||||||
            exit
 | 
					        *)clear;
 | 
				
			||||||
            ;;
 | 
					            show_menu;
 | 
				
			||||||
        *)
 | 
					        ;;
 | 
				
			||||||
            clear
 | 
					      esac
 | 
				
			||||||
            show_menu
 | 
					 | 
				
			||||||
            ;;
 | 
					 | 
				
			||||||
        esac
 | 
					 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
done
 | 
					  done
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue