blob: 4b0df73c6960567b96a3ab189b0d19db35f3f03c (
plain)
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
|
# arg 1: the new package version
post_install() {
# create users
getent passwd smtpd >/dev/null || useradd -d / -u 91 -g 1 smtpd
getent passwd smtpq >/dev/null || useradd -d /var/spool/smtpd -u 92 -g 1 smtpq
:
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
post_install "$1"
if (( $(vercmp $2 5.3.3p1-1) < 0 )); then
echo 'Configuration files have been moved to /etc/smtpd.'
echo 'New users have been added.'
echo 'Check your configuration!'
elif (( $(vercmp $2 5.4) < 0 )); then
echo 'User smtpf is no more required. It will be removed!'
echo 'Check your configuration!'
userdel -f smtpf
fi
:
}
# arg 1: the old package version
post_remove() {
userdel -f smtpd
userdel -f smtpq
if (( $(vercmp $1 5.4) <= 0 )); then
userdel -f smtpf
fi
:
}
# vim:set ts=2 sw=2 et:
|