summaryrefslogtreecommitdiff
path: root/distribution/posix/prerm
blob: 3c5db289417ec88f9c8e7e283eb25d27d185ef17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
LOGF=/tmp/xtrkcad-setup.log
if [ -f "${LOGF}" ] ; then
	chmod 666 ${LOGF}
	echo prerm: $* >> ${LOGF}
else
	LOGF=/dev/null
fi

if [ -d /usr/local/share/xtrkcad ] ; then
	INSTALLDIR=/usr/local/share/xtrkcad
elif [ -d /usr/share/xtrkcad ] ; then
	INSTALLDIR=/usr/share/xtrkcad
else
	echo No existing XTrkCad install >> ${LOGF}
	exit 1
fi

( su -c "sh ${INSTALLDIR}/xtrkcad-setup remove ${INSTALLDIR}" -l $SUDO_USER ) >> ${LOGF} 2>&1

exit 0