summarylogtreecommitdiffstats
path: root/evostream-web.install
blob: 6808297c63f233df284c7449a82b59a59eff831b (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
36
37
38
EVOUSER=evostreamd
EVOGROUP=evostreamd

testError ()
{
	if [ "$?" -ne "0" ]
	then
		echo $1
		exit 1
	fi
}


createUserAndGroup ()
{
	if ! getent group $EVOGROUP >/dev/null
	then
		echo adding group $EVOGROUP
		groupadd $EVOGROUP
		testError "Unable to create group $EVOGROUP"
	fi

	if ! getent passwd $EVOUSER >/dev/null
	then
		echo adding user $EVOUSER
		useradd -c "EvoStream Media Server Daemon" -g $EVOGROUP -r -N -s /usr/sbin/nologin $EVOUSER
	fi
}

applyPermissions ()
{
	chown -R $EVOUSER:$EVOGROUP /var/evo-webroot
}

post_install() {
	createUserAndGroup
	applyPermissions  
}