Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.95 KB | None | 0 0
  1. gnutoo@gnutoo-laptop:~$ cat /etc/rc5.d/S99ondemand
  2. #! /bin/sh
  3. ### BEGIN INIT INFO
  4. # Provides:          ondemand
  5. # Required-Start:    $remote_fs $all
  6. # Required-Stop:
  7. # Default-Start:     2 3 4 5
  8. # Default-Stop:
  9. # Short-Description: Set the CPU Frequency Scaling governor to "ondemand"
  10. ### END INIT INFO
  11.  
  12.  
  13. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  14.  
  15. . /lib/init/vars.sh
  16. . /lib/lsb/init-functions
  17.  
  18. case "$1" in
  19.     start)
  20.         start-stop-daemon --start --background --exec /etc/init.d/ondemand -- background
  21.         ;;
  22.     background)
  23.     sleep 60 # probably enough time for desktop login
  24.  
  25.     for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
  26.     do
  27.         [ -f $CPUFREQ ] || continue
  28.         echo -n ondemand > $CPUFREQ
  29.     done
  30.     ;;
  31.     restart|reload|force-reload)
  32.         echo "Error: argument '$1' not supported" >&2
  33.         exit 3
  34.         ;;
  35.     stop)
  36.         ;;
  37.     *)
  38.         echo "Usage: $0 start|stop" >&2
  39.         exit 3
  40.         ;;
  41. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement