summarylogtreecommitdiffstats
path: root/mcsctl-git.install
blob: db5924c6199994ca939bce6af6a535e5942ec8a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
MCS_USER='mcs'
MCS_GROUP='mcs'

post_install() {
	if ! getent group "$MCS_GROUP" > /dev/null; then
		groupadd "$MCS_GROUP"
	fi

	if ! getent passwd "$MCS_USER" > /dev/null; then
		useradd -c 'Minecraft user' -g "$MCS_GROUP" -s /usr/bin/nologin -m "$MCS_USER"
		passwd -l "$MCS_USER" > /dev/null
	fi
}

post_remove() {
	killall -w -u "$MCS_USER" -s KILL
	userdel -r -f "$MCS_GROUP" &> /dev/null
}