#!/bin/bash

virtualenv_bin="/home/james/temp/bin/"
. ${virtualenv_bin}activate

#Cause bash script to exit if any of the installers
#return with a non-zero return value.
set -e

# Absolute path to this script
SCRIPT=`readlink -f $0`
# Absolute directory this script is in
SCRIPTPATH=`dirname $SCRIPT`

echo -e "\n******************************* Uninstall Begin ********************************"

echo -e "\n*** Uninstalling Pypo ***"
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-uninstall.py

echo -e "\n*** Uninstalling Show Recorder ***"
python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-uninstall.py

echo -e "\n*** Uninstalling Media Monitor ***"
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-uninstall.py

echo -e "\n*** Removing Pypo User ***"
python ${SCRIPTPATH}/../python_apps/remove-pypo-user.py

php ${SCRIPTPATH}/include/airtime-uninstall.php


echo -e "\n****************************** Uninstall Complete ******************************\n"
echo "NOTE: To fully remove all Airtime files, you will also have to manually delete"
echo "      the directories '/srv/airtime'(default storage location of media files)"
echo -e "      and '/etc/airtime'(where the config files are stored).\n"