summarylogtreecommitdiffstats
path: root/rdircd-git.install
blob: c2ca78f758fc134b0f3cd39cd6f6b463659633d5 (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
_PKGGROUP=rdircd
_PKGUSER=rdircd

post_install() {
	if ! getent group ${_PKGGROUP} &>/dev/null; then
		groupadd -r ${_PKGGROUP} >/dev/null
	fi
	if ! getent passwd ${_PKGUSER} &>/dev/null; then
		useradd -r -g ${_PKGUSER} -d /var/lib/rdircd -s /bin/false ${_PKGUSER} >/dev/null
	fi
	chmod -R 770 "/var/lib/rdircd/"
	chown -R ${_PKGUSER}:${_PKGGROUP} "/var/lib/rdircd/"
}

post_upgrade() {
	post_install
}

post_remove() {
	if getent passwd ${_PKGUSER} &>/dev/null; then
		userdel ${_PKGUSER} >/dev/null
	fi
	if getent group ${_PKGGROUP} &>/dev/null; then
		groupdel ${_PKGGROUP} >/dev/null
	fi
}