summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb
blob: 855a64f705df5624f9ab64364489c182f6326c64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp

make_aliasesdb() {
        if [ "$(/usr/sbin/postconf -h alias_database)" = "hash:/etc/aliases" ]
        then
                # /etc/aliases.db may be used by other MTA, make sure nothing
                # has touched it since our last newaliases call
                [ /etc/aliases -nt /etc/aliases.db ] ||
                        [ "$ALIASESDB_STAMP" -nt /etc/aliases.db ] ||
                        [ "$ALIASESDB_STAMP" -ot /etc/aliases.db ] || return 0
                /usr/bin/newaliases
                touch -r /etc/aliases.db "$ALIASESDB_STAMP"
        else
                /usr/bin/newaliases
        fi
}

make_aliasesdb
OpenPOWER on IntegriCloud