aboutsummaryrefslogtreecommitdiffstats
path: root/opensmtpd.install
blob: 71759d587394a29ff2b87426e5830dcc6aac0a5e (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
# 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"
	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
}