summaryrefslogtreecommitdiffstats
path: root/net/boinc-client/pkg-install
blob: 8acfe233d2dbfd2b249e62db12c6a5c1eb6106ed (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
#!/bin/sh

username=%%BOINC_USER%%
group=%%BOINC_GROUP%%
home=%%BOINC_HOME%%
shell=/bin/sh

case $2 in
POST-INSTALL)
    if ! pw usershow ${username} >/dev/null 2>&1; then
	if ! pw useradd ${username} -g ${group} -c BOINC -d ${home} -s ${shell}; then
		err=$?
		echo "WARNING: Unable to create user.  pw returned $err"
		echo "You will need to create a boinc user and chown the boinc dir."
		exit $err
	else
		echo "boinc user created."
	fi
    else
	echo "boinc user found.  using existing boinc user."
    fi
    mkdir -p ${home} ${home}/projects
    chown ${username}:${group} ${home} ${home}/projects
    ;;
esac
OpenPOWER on IntegriCloud