summaryrefslogtreecommitdiff
path: root/extra/fetchmail/fetchmail.install
diff options
context:
space:
mode:
Diffstat (limited to 'extra/fetchmail/fetchmail.install')
-rw-r--r--extra/fetchmail/fetchmail.install20
1 files changed, 20 insertions, 0 deletions
diff --git a/extra/fetchmail/fetchmail.install b/extra/fetchmail/fetchmail.install
new file mode 100644
index 000000000..711cbe568
--- /dev/null
+++ b/extra/fetchmail/fetchmail.install
@@ -0,0 +1,20 @@
+post_install() {
+ # /etc/fetchmail must be owned by fetchmail for daemon to work.
+ echo "If you run fetchmail as a daemon and not a cron job"
+ echo "then 'chown fetchmail /etc/fetchmailrc'"
+ getent passwd fetchmail >/dev/null || usr/sbin/useradd -u 90 -g nobody \
+ -d '/var/run/fetchmail' -c 'Fetchmail daemon' -s /bin/false fetchmail
+}
+
+post_upgrade() {
+ getent passwd fetchmail >/dev/null || usr/sbin/useradd -u 90 -g nobody \
+ -d '/var/run/fetchmail' -c 'Fetchmail daemon' -s /bin/false fetchmail
+
+ if [ "$(vercmp $2 6.3.19)" -lt 0 ] ; then
+ chsh -s /bin/false fetchmail
+ fi
+}
+
+pre_remove() {
+ usr/sbin/userdel fetchmail &>/dev/null
+}