summarylogtreecommitdiffstats
path: root/asus-fan-control.install
blob: ef9f80fd405e5a166a3c087ea23fed9eda0af224 (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
post_install(){
    cat <<EOF
If your model is absent in /usr/share/asus-fan-control/models, you are advised to
use 'asus-fan-control set-temps' to adjust fan speeds prior to enabling a systemd service.
Run 'asus-fan-control get-temps' to get your current fan speed policy.

To start asus-fan-control on boot:
systemctl enable asus-fan-control
EOF
}

## arg 1:  the new package version
## arg 2:  the old package version
post_upgrade() {
    # if older version is <= 2.12.0-1 and asus-fan-control is enabled, re-enable it to update its dependencies
    if [ "$(vercmp '2.12.0-1' "$2" )" != '-1' ] && systemctl -q is-enabled asus-fan-control.service; then
        systemctl enable asus-fan-control.service
    fi

    # there are some changes in 3.0.0, so print the post_install message again and move old config
    if [ "$(vercmp '3.0.0-1' "$2" )" = '1' ]; then
        post_install
        test -f /etc/asus-fan-control/custom-temps && mv /etc/asus-fan-control/{custom-,}temps || true
    fi
}


pre_remove(){
    systemctl disable asus-fan-control
    echo 'You mihgt want to reboot your system to restore the default fan speed'
    if [ -f /etc/asus-fan-control/temps ]; then
        echo "You might also want to remove '/etc/asus-fan-control/temps'"
    fi
}