From 4e1c3a12f5f3eee35598ac7a5db87739d000a3a3 Mon Sep 17 00:00:00 2001 From: "b.waal" Date: Sat, 10 Aug 2024 01:11:34 +0200 Subject: [PATCH] Update Debian/CPU Governor/setup.sh Fixed root/sudo check Fixed error in # Check if file exists --- Debian/CPU Governor/setup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Debian/CPU Governor/setup.sh b/Debian/CPU Governor/setup.sh index 0665bb8..a6d5e71 100644 --- a/Debian/CPU Governor/setup.sh +++ b/Debian/CPU Governor/setup.sh @@ -1,10 +1,11 @@ #!/bin/bash # Precheck -if [ "$EUID" -ne 0 ] +if [ $UID != 0 ]; then TERM=ansi whiptail --title "Info" --infobox "Please run as root!" 7 23 sleep 3 - exit + clear + exit fi @@ -15,7 +16,7 @@ if [ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then "Choose user's permissions" 9 61 3 \ "Performance" "Run the CPU at the maximum frequency" 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 TERM=ansi whiptail --title "Info" --infobox "This CPU/OS does not support a governor!" 7 44 sleep 3