summarylogtreecommitdiffstats
path: root/acpi-eeepc-generic.install
blob: 25c3ad733baa3a0b63eb7fd0b24a280347874b70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
post_install() {

    # Disable "acpid" events handling
    [ -e /etc/acpi/events/anything ] && \
        sed -i 's/^[^#]/#&/' /etc/acpi/events/anything

    # Detect if model is not supported
    eeepc_model=`dmidecode -s system-product-name`
    if [[ ! -e "/etc/acpi/eeepc/models/acpi-eeepc-${eeepc_model}-events.conf" ]]; then
        echo ">>> You're model ${eeepc_model} is not (yet) supported."
        echo ">>> Please report it to http://github.com/nbigaouette/acpi-eeepc-generic/issues"
    fi

    #echo ">>> "

    # Get the model and save it to the configuration file
    . /etc/acpi/eeepc/acpi-eeepc-generic-functions.sh
    get_model

    echo " "
    echo ">>> Configuration is done via /etc/conf.d/acpi-eeepc-generic.conf"
    echo ">>> Note that you will have to COMMENT-out the 'EEEPC_CONF_DONE' option."
    echo ">>> Else you will receive an error/warning when hitting a special key!"
    echo " "
    echo ">>> Please restart acpid to reload actions."
    echo "# /etc/rc.d/acpid restart"
}

post_upgrade() {
    post_install
}

pre_remove() {
    echo " "
    echo ">>> Note that the file /etc/acpi/handler.sh is now the default."
    [ -e /etc/acpi/events/anything ] && \
        sed -e 's/#event/event/g' -e 's/#action/action/g' -i /etc/acpi/events/anything
    echo ">>> Please restart acpid to reload actions."
    echo "# /etc/rc.d/acpid restart"
}