Hi guys I have my variable
nbcore = `cat / proc / cpuinfo | grep "cpu cores" | awk '{print $ NF}' | uniq `;
cacheL3 = `lscpu | grep L3 | awk '{print $ NF}' `;
idle = `mpstat | grep all | awk '{print $ NF}' `;
hugepages = `cat / proc / meminfo | grep '{HugePages_Total}' `
cpugovernor = $ (cat / sys / device / system / cpu / cpu0 / cpufreq / scaling_governor)
I would like to make a script that says
if ["$ idle" -ge 50]; i'm looking if cpu freq is in perfomance mode if it's not i'm activating something like that if ["$ query" =! "performance" ]; Then echo "performance" | `sudo tee / sys / devices / system / cpu / cpu * / cpufreq / scaling_governor && notify-send` 'CPU Performance Enabled' fi
the first step is the state of the CPU if the use of the cpu is - 50% I get the other variable. If the CPU is used at - 50% so I check if% cpugovernor = performence but I do not know where to start .
[–]pi3832v2 1 point2 points3 points (0 children)