#!/bin/sh
set -e
tomcats="tomcat7 tomcat8 tomcat9 tomcat10"
for d in $tomcats
do
	testdir=/var/lib/$d
	if [ -d "$testdir" ]
	then
		tomcatdir=$testdir
		tomcatuser=$d
	fi
done

if [ -z "$tomcatdir" ]
then
	echo "tomcatdir not found, this should not happen."
	exit 1
fi
webappdir=$tomcatdir/webapps/dassadmin

if [ "$1" = "purge" ]
then
	rm -f $webappdir/WEB-INF/tools.xml
	rm -f $webappdir/WEB-INF/web.xml
fi
