summaryrefslogtreecommitdiff
blob: 2bdba4c548b36069035bf69f42389eb1f3281ed5 (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}
if [ $1 = "install" ]; then
	# fix location
	cd ${VHOST_ROOT}/${PF}
	sed -e "s|${MY_HOSTROOTDIR}/${PF}|${VHOST_ROOT}/${PF}|g
		s|${MY_HTDOCSDIR}|${MY_INSTALLDIR}|g" -i bin/* lib/RT.pm sbin/* etc/RT_Config.pm || die

	# fix Apache configs
	sed -e "s|RT_DIR|${VHOST_ROOT}/${PF}|g
		s|HTDOCS|${MY_INSTALLDIR}|g" -i ${MY_SERVERCONFIGDIR}/apache* || die

	# check for upgrades
	cd ${VHOST_ROOT}/${PF}/upgrade
	echo "You may need to update your database."
	echo "For each item in the output below"
	echo "whose name is greater than your previously installed RT version,"
	echo "rt-setup-database --action schema --datadir ${VHOST_ROOT}/${PF}/upgrade/<version>"
	echo "rt-setup-database --action acl --datadir ${VHOST_ROOT}/${PF}/upgrade/<version>"
	echo "rt-setup-database --action insert --datadir ${VHOST_ROOT}/${PF}/upgrade/<version>"
	echo "Don't forget to read the online installation guide for more details"
	ls

elif [ $1 = "clean" ]; then
	if [[ "${VHOST_ROOT}${PF}" ]]; then 
		rm -rf ${VHOST_ROOT}/${PF}/bin ${VHOST_ROOT}/${PF}/lib/RT.pm ${VHOST_ROOT}/${PF}/sbin
	else
		echo "Variables not set!"
	fi
fi