From 8b7b4f2e5a808cb0c1226c23469fa57751eba190 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 4 Sep 2012 00:04:04 +0000 Subject: Tue Sep 4 00:04:04 UTC 2012 --- testing/fetchmail/fetchmail.install | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 testing/fetchmail/fetchmail.install (limited to 'testing/fetchmail/fetchmail.install') diff --git a/testing/fetchmail/fetchmail.install b/testing/fetchmail/fetchmail.install new file mode 100644 index 000000000..81b374c57 --- /dev/null +++ b/testing/fetchmail/fetchmail.install @@ -0,0 +1,26 @@ +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/lib/fetchmail' -c 'Fetchmail daemon' -s /bin/false fetchmail + if [[ ! -d run/fetchmail ]]; then + usr/bin/systemd-tmpfiles --create usr/lib/tmpfiles.d/fetchmail.conf + fi +} + +post_upgrade() { + getent passwd fetchmail >/dev/null || usr/sbin/useradd -u 90 -g nobody \ + -d '/var/lib/fetchmail' -c 'Fetchmail daemon' -s /bin/false fetchmail + + if [ "$(vercmp $2 6.3.19-3)" -lt 0 ] ; then + usermod -d '/var/lib/fetchmail' -s /bin/false fetchmail + fi + if [[ ! -d run/fetchmail ]]; then + usr/bin/systemd-tmpfiles --create usr/lib/tmpfiles.d/fetchmail.conf + fi +} + +pre_remove() { + usr/sbin/userdel fetchmail &>/dev/null +} -- cgit v1.2.3-54-g00ecf