blob: 855a64f705df5624f9ab64364489c182f6326c64 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001#!/bin/sh
2
3ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp
4
5make_aliasesdb() {
6 if [ "$(/usr/sbin/postconf -h alias_database)" = "hash:/etc/aliases" ]
7 then
8 # /etc/aliases.db may be used by other MTA, make sure nothing
9 # has touched it since our last newaliases call
10 [ /etc/aliases -nt /etc/aliases.db ] ||
11 [ "$ALIASESDB_STAMP" -nt /etc/aliases.db ] ||
12 [ "$ALIASESDB_STAMP" -ot /etc/aliases.db ] || return 0
13 /usr/bin/newaliases
14 touch -r /etc/aliases.db "$ALIASESDB_STAMP"
15 else
16 /usr/bin/newaliases
17 fi
18}
19
20make_aliasesdb