0

I want to make a program with a GUI that controls Intel Turbo Boost through intel_pstate/no_turbo.

btnDisable will trigger:

echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo

btnEnable will trigger:

echo -n 0 > /sys/devices/system/cpu/intel_pstate/no_turbo

However, I want to run those commands from a .sh file, and ask for root permissions to do so, how can I achieve this?

Jonny Henly
  • 4,023
  • 4
  • 26
  • 43
  • I would simply print an error saying something like "need to be run as root" when it fails – zapl Jun 06 '16 at 20:06
  • but I want the program to ask for root permissions and run it – Sara P.P. Jun 06 '16 at 20:14
  • http://stackoverflow.com/questions/36828036/is-there-a-way-for-a-java-app-to-gain-root-permissions and http://stackoverflow.com/questions/7115182/java-ask-root-privileges-on-ubuntu - it's fairly non-standard to especially for java applications to request root. – zapl Jun 06 '16 at 20:56

0 Answers0