iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
distro specific fixes
[distro-setup]
/
mail-setup
diff --git
a/mail-setup
b/mail-setup
index cdbf9e8ef4216f71453e4d131ee9c40706b7ec20..616d39bae20e9b2fdfe033754a39fb2e4fd297d8 100755
(executable)
--- a/
mail-setup
+++ b/
mail-setup
@@
-453,9
+453,17
@@
Pin-Priority: 500
EOF
fi
EOF
fi
+
+unit-exists() {
+ systemctl cat $1 &>/dev/null
+}
+spamd-timer-exists() {
+ unit-exists spamassassin-maintenance.timer
+}
+
# name change in t12, and now timer instead of cron option in /etc/default
first_spamd_run=false
# name change in t12, and now timer instead of cron option in /etc/default
first_spamd_run=false
-if ! s
ystemctl cat spamassassin-maintenance.timer &>/dev/null
; then
+if ! s
pamd-timer-exists
; then
first_spamd_run=true
fi
first_spamd_run=true
fi
@@
-468,10
+476,14
@@
spamd_ser=spamd
if systemctl cat spamassassin &>/dev/null; then
spamd_ser=spamassassin
elif $first_spamd_run; then
if systemctl cat spamassassin &>/dev/null; then
spamd_ser=spamassassin
elif $first_spamd_run; then
- systemctl start spamassassin-maintenance
+ if spamd-timer-exists; then
+ systemctl start spamassassin-maintenance
+ fi
fi
fi
-systemctl enable --now spamassassin-maintenance.timer
+if spamd-timer-exists; then
+ systemctl enable --now spamassassin-maintenance.timer
+fi
# note: pyzor debian readme says you need to run some initialization command
# but its outdated.
# note: pyzor debian readme says you need to run some initialization command
# but its outdated.