/rc1.d/K20acpi-support

http://github.com/brinkman83/bashrc · #! · 31 lines · 24 code · 7 blank · 0 comment · 0 complexity · e2023e93fdc2f17aaa9758085af7fb73 MD5 · raw file

  1. #!/bin/bash
  2. # INIT script to check whether we're on batteries, and so start with laptop
  3. # mode etc enabled.
  4. # BUGS: unless we start *really* late, we have no way of throttling
  5. # xscreensaver, since it won't be there to command.
  6. . /usr/share/acpi-support/power-funcs
  7. test -f /lib/lsb/init-functions || exit 1
  8. . /lib/lsb/init-functions
  9. test -d /var/lib/acpi-support || exit 0
  10. shopt -s nullglob
  11. case "$1" in
  12. start)
  13. log_begin_msg "Checking battery state..."
  14. /etc/acpi/power.sh
  15. log_end_msg 0
  16. ;;
  17. stop)
  18. log_begin_msg "Disabling power management..."
  19. /etc/acpi/power.sh false
  20. log_end_msg 0
  21. ;;
  22. *)
  23. ;;
  24. esac