Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp |
| 4 | |
| 5 | make_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 | |
| 20 | make_aliasesdb |