summaryrefslogtreecommitdiff
path: root/net/boinc-client/files/pkg-install.in
blob: d593a1413a1ee47b65ba2b1da436b3cd523e7f6e (plain) (blame)
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
#!/bin/sh
#
# $FreeBSD$
#

PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin

user=%%BOINC_CLIENT_USER%%
group=%%BOINC_CLIENT_GROUP%%
home="%%BOINC_CLIENT_HOME%%"
option_manager=%%OPTION_MANAGER%%
option_user=%%OPTION_USER%%

case $2 in
POST-INSTALL)
	if [ -n "${option_user}" ] ; then
		if [ -n "${option_manager}" -a ! -e "${home}/skins" -a ! -L "${home}/skins" ]; then
			ln -s "%%PREFIX%%/share/boinc/skins" "${home}/skins"
		fi
		if [ ! -e "${home}/ca-bundle.crt" -a ! -L "${home}/ca-bundle.crt" ]; then
			ln -s "%%LOCALBASE%%/share/certs/ca-root-nss.crt" "${home}/ca-bundle.crt"
		fi
		echo "Adjusting file ownership in \"${home}\" to ${user}:${group}"
		chown -hR ${user}:${group} "${home}"
	fi
	;;
esac

exit 0