summaryrefslogtreecommitdiff
blob: 04a9feef674c96b425683bad3a6de7cdb56a0242 (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
#!/bin/bash
PF=${PN}-${PVR}

die() {
	echo "******"
	echo $1
	echo "******"
}

if [ $1 = "install" ]; then
	# edit Apache configs
	cd ${VHOST_ROOT}/${PF}/scripts
	sed -e "s|/opt/otrs/var/httpd/htdocs/|${MY_INSTALLDIR}/|g" -i apache-httpd.include.conf apache2-httpd.include.conf || die "sed 1 failed"
	
	# set $HOME
	grep -lR "/opt" * | xargs sed -i "s|/opt/otrs|${VHOST_ROOT}/${PF}|g" || die "sed failed"
	
	sed -i "s|/opt/otrs|${VHOST_ROOT}/${PF}|g" ${VHOST_ROOT}/${PF}/Kernel/Config.pm || die "sed failed"

	# set permissions
	${VHOST_ROOT}/${PF}/bin/SetPermissions.sh  ${VHOST_ROOT}/${PF} otrs apache apache apache > /dev/null || die "Could not set permissions"


elif [ $1 = "clean" ]; then
	echo "Please examine the contents of the following directories"
	echo "and delete anything that is no longer necessary"
	echo 
	echo ${VHOST_ROOT}/${PF}
	echo ${MY_INSTALLDIR}
fi