On Ubuntu 14.04, I hope to set the cpu frequency upon resuming from suspension, so I created a file /etc/pm/sleep.d/20_cpu_freq
with content:
#!/bin/bash
case $1 in
resume)
sudo cpufreq-set -f 1.60GHz -c0
sudo cpufreq-set -f 1.60GHz -c1
;;
thaw)
sudo cpufreq-set -f 1.60GHz -c0
sudo cpufreq-set -f 1.60GHz -c1
;;
esac
But the cpu frequency isn't set upon waking up. What might be the reason?
Can I run sudo
command in the script? Will that require me to type in the password of root?
Thanks!
expect interpreter
– PersianGulf May 10 '15 at 01:28