summarylogtreecommitdiffstats
path: root/whip-server.install
blob: 9066e238d203310d978ceb4426b3bcf2e8822e4c (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
post_install() {
	getent group inworldz
	if [ $? -ne 0 ]; then
		groupadd -r inworldz
	fi
	
	getent passwd inworldz
	if [ $? -ne 0 ]; then
		useradd -r -g inworldz -d /srv/inworldz -M inworldz
	fi
	
	chown -R inworldz:inworldz /srv/inworldz
}

post_upgrade() {
	chown -R inworldz:inworldz /srv/inworldz
}

pre_remove() {
	systemctl stop whip-server.service
	systemctl disable whip-server.service
}

post_remove() {
	[[ -d /srv/inworldz ]] && chown -R root:root /srv/inworldz
	
	if getent passwd inworldz; then
		userdel inworldz
	fi
	if getent group inworldz; then
		groupdel inworldz
	fi
}