From 68e8645dcd1ce619af6d92f3645c43b15bc5ac71 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 3 Jul 2013 00:48:29 -0700 Subject: Wed Jul 3 00:48:29 PDT 2013 --- community/opensmtpd/opensmtpd.install | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'community/opensmtpd/opensmtpd.install') diff --git a/community/opensmtpd/opensmtpd.install b/community/opensmtpd/opensmtpd.install index 0e3d8c0e1..48366c15c 100644 --- a/community/opensmtpd/opensmtpd.install +++ b/community/opensmtpd/opensmtpd.install @@ -1,14 +1,29 @@ # arg 1: the new package version -# arg 2: the old package version +post_install() { + # create users + getent passwd smtpd >/dev/null || useradd -d / -u 91 -g 1 smtpd + getent passwd smtpq >/dev/null || useradd -d /var/spool/smtpd -u 92 -g 1 smtpq + getent passwd smtpf >/dev/null || useradd -d / -u 93 -g 1 smtpf + # initialise aliase db + #[[ -e /etc/smtpd/aliases.db ]] || makemap -t aliases /etc/smtpd/aliases + true +} # arg 1: the new package version -post_install() { - makemap -t aliases /etc/aliases +# arg 2: the old package version +post_upgrade() { + post_install "$1" + if (( $(vercmp $2 5.3.3p1-1) < 0 )); then + echo 'Configuration files have been moved to /etc/smtpd.' + echo 'New users have been added.' + echo 'Check your configuration!' + fi } # arg 1: the old package version post_remove() { - rm -f /etc/aliases.db + for _u in smtpd smtpq smtpf; do userdel -f "$_u"; done + true } # vim:set ts=2 sw=2 et: -- cgit v1.2.3-54-g00ecf