~ubuntu-branches/ubuntu/trusty/acpid/trusty-proposed

« back to all changes in this revision

Viewing changes to examples/default.sh

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-11-17 14:50:01 UTC
  • mfrom: (2.1.12 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091117145001-y5hevyg7gcg6uwjk
Tags: 1.0.10-4
Updated netlink patch to version 6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# Default acpi script that takes an entry for all actions
3
 
 
4
 
set $*
5
 
 
6
 
# Take care about the way events are reported
7
 
ev_type=`echo "$1" | cut -d/ -f1`
8
 
if [ "$ev_type" = "$1" ]; then
9
 
        event="$2";
10
 
else
11
 
        event=`echo "$1" | cut -d/ -f2`
12
 
fi
13
 
 
14
 
 
15
 
case "$ev_type" in
16
 
    button)
17
 
        case "$event" in
18
 
            power)
19
 
                logger "acpid: received a shutdown request"
20
 
                /sbin/init 0
21
 
                break
22
 
                ;;
23
 
             *)
24
 
                logger "acpid: action $2 is not defined"
25
 
                ;;
26
 
        esac
27
 
    ;;
28
 
 
29
 
    *)
30
 
        logger "ACPI group $1 / action $2 is not defined"
31
 
        ;;
32
 
esac