#!/bin/bash
path=$(pwd)
find "$path/bin/" -name "*.log" -type f -delete
rm -rf "$path/logs"
rm -rf "$path/temp"
find "$path/webapps/" -name "*.war" -type f -delete

find "$path/work/" -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;

find "$stdir/webapps/" -mindepth 1 -maxdepth 1 -type d | while read dir; do
    case "$(basename "$dir")" in
        docs|host-manager|manager|ROOT)
            ;; # do nothing for these directories
        *)
            rm -rf "$dir"
            ;;
    esac
done

[ -d "$path/wtpwebapps" ] && rm -rf "$path/wtpwebapps"

echo "Finished cleaning up $path folder."
read -p "Press enter to continue..."