Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Reventlov

By: a guest on Feb 20th, 2011  |  syntax: Bash  |  size: 1.19 KB  |  views: 151  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. #!/bin/sh
  3. # File: "/etc/pm/sleep.d/20_custom-ehci_hcd".
  4. case "${1}" in
  5.         hibernate|suspend)
  6.               # La je sauvegarde le niveau du rétroéclairage du clavier
  7.                cp /sys/class/leds/asus\:\:kbd_backlight/brightness /tmp/keyboard_backlit_save
  8.               # Ensuite je l'éteint sinon il va clignoter
  9.                echo 0 > /sys/class/leds/asus\:\:kbd_backlight/brightness
  10.               # Unbind ehci_hcd for first device XXXX:XX:XX.X:
  11.                echo -n "XXXX:XX:XX.X" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
  12.               # Unbind ehci_hcd for second device XXXX:XX:XX.X:
  13.                echo -n "XXXX:XX:XX.X" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
  14.         ;;
  15.         resume|thaw)
  16.               # Bind ehci_hcd for first device XXXX:XX:XX.X:
  17.               echo -n "XXXX:XX:XX.X" | tee /sys/bus/pci/drivers/ehci_hcd/bind
  18.               # Bind ehci_hcd for second device XXXX:XX:XX.X:
  19.               echo -n "XXXX:XX:XX.X" | tee /sys/bus/pci/drivers/ehci_hcd/bind
  20.               # Je restore le rétroéclairage du clavier
  21.               lvl=$(cat /tmp/keyboard_backlit_save)
  22.               echo $lvl > /sys/class/leds/asus\:\:kbd_backlight/brightness
  23.         ;;
  24. esac
clone this paste RAW Paste Data