summaryrefslogtreecommitdiff
path: root/distribution/posix/prerm
diff options
context:
space:
mode:
Diffstat (limited to 'distribution/posix/prerm')
-rwxr-xr-xdistribution/posix/prerm22
1 files changed, 22 insertions, 0 deletions
diff --git a/distribution/posix/prerm b/distribution/posix/prerm
new file mode 100755
index 0000000..3c5db28
--- /dev/null
+++ b/distribution/posix/prerm
@@ -0,0 +1,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
+