updated on Thu Jan 12 20:00:29 UTC 2012
[aur-mirror.git] / nullmailer / nullmailer.install
blobe8f1051e357dc6288dc53ba39d4b0b95b30e7f40
1 # arg 1: the new package version
2 post_install() {
4   echo "==> Creating nullmail user"
5   getent group nullmail > /dev/null || groupadd nullmail
6   getent passwd nullmail > /dev/null || useradd -c "Nullmail mail server" -g nullmail -s /bin/false -d /dev/null nullmail
7   
8   echo "==> Fixing permissions"
10   chown nullmail /var/nullmailer/*
11   chown nullmail /usr/sbin/nullmailer-queue
12   chmod u+s /usr/sbin/nullmailer-queue
13   chown nullmail /usr/bin/mailq
14   chmod u+s /usr/bin/mailq
16   echo "==> Configuring"
17   [ -s /etc/nullmailer/me ] || /bin/hostname > /etc/nullmailer/me
19   [ -s /etc/nullmailer/remotes  ] || \
20   echo -e "\n\n#Type your mail relay hosts at the top, one per line" > \
21   /etc/nullmailer/remotes
25 pre_remove() {
27   echo "==> Stopping nullmailer"
28   sv stop nullmailer >& /dev/null
29   rm -f /var/service/nullmailer
30   echo "==> Removing nullmailer user and group"
31   usr/sbin/userdel nullmail >& /dev/null
32   usr/sbin/groupdel nullmail >& /dev/null
33   
36 op=$1
37 shift
39 $op $*