#!/bin/sh

BINDIR=/usr/bin
INSTALLDIR=/usr/local/thekompany

if [ `id -u` != "0" ]
then
    echo ""
    echo "Sorry, you are not root."
    echo ""
    exit 1
fi

echo -e "Uninstalling kiviomp...\n"

echo -en "Do you want to remove binary file\n $INSTALLDIR/kiviomp/kiviomp ? (please, type 'yes'/'no') "
read yn1

if [ $yn1 = "yes" ]
then
    rm -f $BINDIR/kiviomp
    rm -f $INSTALLDIR/kiviomp/kiviomp
    echo -e "Binary removed.\n"
fi

echo -en "Do you want to remove stencils placed in\n $INSTALLDIR/kiviomp/stencils ? (please, type 'yes'/'no') "
read yn2

if [ $yn2 = "yes" ]
then
    rm -rf $INSTALLDIR/kiviomp/stencils
    echo -e "Stencils removed.\n"
fi

if [ $yn1 = "yes" -a $yn2 = "yes" ]
then
    rm -rf $INSTALLDIR/kiviomp
fi
