Advertisement
Lekensteyn

acpi tests v6

Aug 1st, 2011
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.02 KB | None | 0 0
  1. #!/bin/sh
  2. # From http://hybrid-graphics-linux.tuxfamily.org/index.php?title=ACPI_calls
  3. # Do not forget the backslash before
  4.  ON='\_SB.PCI0.PEG0.PEGP._ON'
  5. OFF='\_SB.PCI0.PEG0.PEGP._OFF'
  6.  
  7. if ! lsmod | grep -q acpi_call; then
  8.     if ! sudo modprobe acpi_call; then
  9.         echo "Failed to load acpi-call"
  10.         [ "${0##/bin}" = "$0" ] && exit || return
  11.     fi
  12. fi
  13.  
  14. load()  { sudo modprobe nvidia-current;}
  15. unload(){ sudo rmmod nvidia;}
  16. on()  { echo "$ON"  | sudo tee /proc/acpi/call >/dev/null;sudo cat /proc/acpi/call;}
  17. off() { echo "$OFF" | sudo tee /proc/acpi/call >/dev/null;sudo cat /proc/acpi/call;}
  18.  
  19. # only run when not sourced
  20. if [ "${0##/bin}" = "$0" ]; then
  21. ran=false
  22. run() { $ran&&echo "Press Enter"&&read&&sleep 2;echo "Running test $1";ran=true;}
  23.  
  24. run 1
  25. on;load;unload;off
  26.  
  27. run 2
  28. on;load;on;unload;off
  29.  
  30. run 3
  31. on;load;off;unload
  32.  
  33. run 4
  34. on;on;load;unload;off
  35.  
  36. run 5
  37. off;on;load;unload;off
  38.  
  39. run 6
  40. load;on;unload;off
  41.  
  42. run 7
  43. load;on;load;unload;off
  44.  
  45. run 8
  46. load;on;load;off;unload
  47.  
  48. on
  49. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement