#!/bin/bash function error { echo -e "\e[31m$1\e[39m" exit 1 } DIRECTORY="$(dirname "$(dirname "$(dirname "$0")")")" "${DIRECTORY}/purge-installed" "$(dirname "$0")" || exit 1 #run uninstall script, saying 'yes' to the first question, and 'no' to the second question echo -e "y\nn" | /opt/tboplayer/setup.sh uninstall || error "failed to uninstall!"