summarylogtreecommitdiffstats
path: root/pacman-auto-update.install
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-auto-update.install')
-rw-r--r--pacman-auto-update.install27
1 files changed, 27 insertions, 0 deletions
diff --git a/pacman-auto-update.install b/pacman-auto-update.install
new file mode 100644
index 000000000000..ad57842cea87
--- /dev/null
+++ b/pacman-auto-update.install
@@ -0,0 +1,27 @@
+post_install() {
+ systemctl enable --now pacman-auto-update.timer || true
+}
+
+post_upgrade() {
+ systemctl --system daemon-reload >/dev/null || true
+ systemctl restart pacman-auto-update.timer || true
+}
+
+pre_remove() {
+ if [ -d /run/systemd/system ]; then
+ systemctl stop pacman-auto-update.timer >/dev/null
+ fi
+}
+
+post_remove() {
+ if [ -d /run/systemd/system ]; then
+ systemctl --system daemon-reload >/dev/null || true
+ fi
+
+ # In case this system is running systemd, we make systemd reload the unit files
+ # to pick up changes.
+ if [ -d /run/systemd/system ] ; then
+ systemctl --system daemon-reload >/dev/null || true
+ fi
+}
+