diff options
author | Zhanibek Adilbekov | 2020-12-07 15:15:34 +0600 |
---|---|---|
committer | Zhanibek Adilbekov | 2020-12-07 15:15:34 +0600 |
commit | 848b6a36c6cd0817d7abeb8061f91c4c11fcf926 (patch) | |
tree | 9f15e8109a345e4d33c5ea7b70c08b0c681d13f9 | |
parent | aaa36515751b153b8d6f937c843834e280795c8d (diff) | |
download | aur-848b6a36c6cd0817d7abeb8061f91c4c11fcf926.tar.gz |
fix: restore cpufreqctl binary from backup
-rw-r--r-- | auto-cpufreq.install | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/auto-cpufreq.install b/auto-cpufreq.install index 7a0da8434622..e09d2087ee44 100644 --- a/auto-cpufreq.install +++ b/auto-cpufreq.install @@ -1,27 +1,35 @@ post_install() { - # This is needed on SELinux enabled systems (see also ConditionPathExists in .service) - touch /var/log/auto-cpufreq.log + # 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 '' + 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 '' + 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 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 } |