PageRenderTime 92ms CodeModel.GetById 87ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 5# BUGS: unless we start *really* late, we have no way of throttling 
 6# xscreensaver, since it won't be there to command.
 7. /usr/share/acpi-support/power-funcs
 8
 9test -f /lib/lsb/init-functions || exit 1
10. /lib/lsb/init-functions
11
12test -d /var/lib/acpi-support || exit 0
13
14shopt -s nullglob
15
16case "$1" in
17  start)
18    log_begin_msg "Checking battery state..."
19    /etc/acpi/power.sh
20    log_end_msg 0
21    ;;
22  stop)
23    log_begin_msg "Disabling power management..."
24    /etc/acpi/power.sh false
25    log_end_msg 0
26    ;;
27  *)
28  ;;
29esac
30        
31