aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mailman/pkg-install
blob: 11add7d3e514057b3685e7bef136906095ca4a7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/sh
#
# $FreeBSD$

PATH=/bin:/usr/bin:/usr/sbin

case $2 in

POST-INSTALL)
  echo "---> Starting post-install script:"

  /bin/chmod g+s "%%MAILMANDIR%%" || exit 1

  echo "---> Checking crontab(5) file for user \"%%USER%%\""

  if [ -e /var/cron/allow ]; then
  echo "%%USER%%" >> /var/cron/allow
  fi

  if /usr/bin/crontab -u "%%USER%%" -l >/tmp/mmctab$$ 2>&1 ; then
      if test -s /tmp/mmctab$$; then
          echo "---> \"%%USER%%\" already has a crontab.  Not overwriting it"
          echo "---> Please merge any changes from the standard crontab file"
          echo "--->     %%MAILMANDIR%%/cron/crontab.in"
      else
          echo "---> Installing crontab(5) file for user \"%%USER%%\""
          /usr/bin/crontab -u "%%USER%%" "%%MAILMANDIR%%/cron/crontab.in" || exit 1
      fi
  else
      echo "---> Creating crontab(5) file for user \"%%USER%%\""
      /usr/bin/crontab -u "%%USER%%" "%%MAILMANDIR%%/cron/crontab.in" || exit 1
  fi
  rm -f /tmp/mmctab$$

  echo "---> Checking (and fixing) file and directory permissions"
  %%MAILMANDIR%%/bin/check_perms -f >/dev/null 2>&1
  ;;

esac