summarylogtreecommitdiffstats
path: root/auto-cpufreq.install
blob: e09d2087ee44cc9a955559ac387241838b108650 (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
post_install() {
    # This is needed on SELinux enabled systems (see also ConditionPathExists in .service)
    touch /var/log/auto-cpufreq.log

    echo ''
    echo 'Enable auto-cpufreq daemon service at boot:'
    echo 'systemctl enable --now auto-cpufreq'
    echo ''
    echo 'To view live log, run:'
    echo 'auto-cpufreq --log'
    echo ''
}

post_upgrade() {
    echo ''
    echo 'Reload systemd manager configuration:'
    echo 'systemctl daemon-reload'
    echo ''
    echo 'Restart auto-cpufreq daemon service:'
    echo 'systemctl restart auto-cpufreq'
    echo ''
}

post_remove() {
    # Remove auto-cpufreq log file
    rm /var/log/auto-cpufreq.log

    # Remove auto-cpufreq's cpufreqctl binary
    rm /usr/bin/cpufreqctl

    # Restore original cpufreqctl binary if backup was made
    if [ -f "/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
        mv /usr/bin/cpufreqctl.auto-cpufreq.bak /usr/bin/cpufreqctl
    fi
}