diff options
author | fademind | 2017-01-06 14:08:23 +0100 |
---|---|---|
committer | fademind | 2017-01-06 14:08:23 +0100 |
commit | 405ab15d1596de6880dec2349aa50bf3f4850755 (patch) | |
tree | e72384b6141f048426644d51e1216787453b750f | |
parent | 1a167d1f17d9d2895fcf385cc5976f87c5db6dba (diff) | |
download | aur-405ab15d1596de6880dec2349aa50bf3f4850755.tar.gz |
major update 20170104
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | asus-nb-wmi-reload.install | 28 |
2 files changed, 22 insertions, 8 deletions
@@ -1,7 +1,7 @@ # Maintainer: FadeMind <fademind@gmail.com> pkgname=asus-nb-wmi-reload-git -pkgver=20160603 +pkgver=20170104 pkgrel=1 pkgdesc="Systemd service for reload Asus Notebooks WMI Hotkey Driver after resume for restoring light on WLAN LED" arch=('any') diff --git a/asus-nb-wmi-reload.install b/asus-nb-wmi-reload.install index cc2bf5795e3c..5245648d859d 100644 --- a/asus-nb-wmi-reload.install +++ b/asus-nb-wmi-reload.install @@ -1,13 +1,27 @@ -post_install() { - printf "NOTE: You need manually enable the systemd services after install via commands:\n" - printf "sudo systemctl enable asus-nb-wmi-reload\n" +asus-nb-wmi-reload_enabled() { + systemctl is-enabled asus-nb-wmi-reload.service &> /dev/null + if [ $? -eq 0 ]; then + echo 'Service asus-nb-wmi-reload is enabled already' + else + echo 'Enabling asus-nb-wmi-reload service...' + systemctl enable asus-nb-wmi-reload.service &> /dev/null + fi } post_upgrade() { - post_install %1 + asus-nb-wmi-reload_enabled + systemctl daemon-reload +} + +post_install() { + post_upgrade } -post_remove() { - printf "NOTE: You need manually disable the systemd services after remove via commands:\n" - printf "sudo systemctl disable asus-nb-wmi-reload\n" +pre_remove() { + echo 'Disabling asus-nb-wmi-reload service...' + systemctl is-enabled asus-nb-wmi-reload.service &> /dev/null + if [ $? -eq 0 ]; then + systemctl disable asus-nb-wmi-reload.service &> /dev/null + fi + systemctl daemon-reload } |