| 1 |
#!/bin/sh |
| 2 |
# postinst script for barman |
| 3 |
|
| 4 |
set -e |
| 5 |
|
| 6 |
case "$1" in |
| 7 |
configure) |
| 8 |
# Add barman to /etc/aliases on install; not on upgrade |
| 9 |
if [ -z "$2" ]; then |
| 10 |
if [ -f /etc/aliases ] || [ -L /etc/aliases ]; then |
| 11 |
if ! grep -qi "^barman[[:space:]]*:" /etc/aliases; then |
| 12 |
echo "barman: root" >> /etc/aliases |
| 13 |
test -x "$(command -v newaliases)" && newaliases || : |
| 14 |
fi |
| 15 |
fi |
| 16 |
fi |
| 17 |
|
| 18 |
# sysusers.d never fixes users that already exist. |
| 19 |
# 3.20.0-1 used "u!". On systemd 257+ this sets an expiry date |
| 20 |
# and blocks cron and archive-wal. Clear it: sysusers now uses |
| 21 |
# plain "u". |
| 22 |
if [ -n "$2" ]; then |
| 23 |
chage -E -1 barman 2>/dev/null || : |
| 24 |
fi |
| 25 |
;; |
| 26 |
|
| 27 |
abort-upgrade|abort-remove|abort-deconfigure) |
| 28 |
;; |
| 29 |
|
| 30 |
*) |
| 31 |
echo "postinst called with unknown argument \`$1'" >&2 |
| 32 |
exit 1 |
| 33 |
;; |
| 34 |
esac |
| 35 |
|
| 36 |
#DEBHELPER# |
| 37 |
|
| 38 |
exit 0 |