Update Debian/CPU Governor/setup.sh

Fixed root/sudo check
Fixed error in # Check if file exists
This commit is contained in:
b.waal 2024-08-10 01:11:34 +02:00
parent fd890f8ace
commit 4e1c3a12f5

View File

@ -1,10 +1,11 @@
#!/bin/bash #!/bin/bash
# Precheck # Precheck
if [ "$EUID" -ne 0 ] if [ $UID != 0 ]; then
TERM=ansi whiptail --title "Info" --infobox "Please run as root!" 7 23 TERM=ansi whiptail --title "Info" --infobox "Please run as root!" 7 23
sleep 3 sleep 3
exit clear
exit
fi fi
@ -15,7 +16,7 @@ if [ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then
"Choose user's permissions" 9 61 3 \ "Choose user's permissions" 9 61 3 \
"Performance" "Run the CPU at the maximum frequency" OFF \ "Performance" "Run the CPU at the maximum frequency" OFF \
"Ondemand" "Scales the frequency according to load" OFF \ "Ondemand" "Scales the frequency according to load" OFF \
"Powersave" "Run the CPU at the minimum frequency" ON 3>&1 1>&2 2>&3)" "Powersave" "Run the CPU at the minimum frequency" ON 3>&1 1>&2 2>&3)
else else
TERM=ansi whiptail --title "Info" --infobox "This CPU/OS does not support a governor!" 7 44 TERM=ansi whiptail --title "Info" --infobox "This CPU/OS does not support a governor!" 7 44
sleep 3 sleep 3