summarylogtreecommitdiffstats
path: root/macfanctld.install
diff options
context:
space:
mode:
authorJames An2015-07-10 22:25:32 -0400
committerJames An2015-07-10 22:25:32 -0400
commit88951dcbb8659c3cce4bf7de97067d26c6e20e4b (patch)
tree662a8cb2f15581bf79eeb8579ad3f2dc3038a128 /macfanctld.install
parentc739752aad82da09315774cf1d066cd5e900f975 (diff)
downloadaur-88951dcbb8659c3cce4bf7de97067d26c6e20e4b.tar.gz
Changed the service unit to better survive failures and added an install file to stop the service unit if active on remove and restart the service unit if active prior to an upgrade.
Diffstat (limited to 'macfanctld.install')
-rw-r--r--macfanctld.install26
1 files changed, 26 insertions, 0 deletions
diff --git a/macfanctld.install b/macfanctld.install
new file mode 100644
index 000000000000..473e4ab0a5d3
--- /dev/null
+++ b/macfanctld.install
@@ -0,0 +1,26 @@
+pre_upgrade() {
+ local _active=/tmp/.macfanctld
+ systemctl daemon-reload
+ if [ $(systemctl is-active macfanctld.service) ]; then
+ systemctl --quiet stop macfanctld.service
+ touch $_active
+ elif [ -f $_active ]; then
+ rm --force $_active
+ fi
+}
+
+post_upgrade() {
+ local _active=/tmp/.macfanctld
+ systemctl daemon-reload
+ if [ -f $_active ]; then
+ systemctl --quiet start macfanctld.service
+ rm --force $_active
+ fi
+}
+
+pre_remove() {
+ if [ $(systemctl is-active macfanctld.service) ]; then
+ systemctl --quiet stop macfanctld.service
+ fi
+}
+