#!/bin/bash
#
# deletes all Armagetron Advanced files (except the user files)

INSTALL=/usr/games/armagetronad
BIN=/usr/bin

for f in $INSTALL/rc.d/armagetronad*; do
	$f status && $f stop
done

if [ "" != "" ] ; then
    echo "Manual uninstallation denied; use \"rpm -e armagetronad\" to uninstall."
    exit -1
fi

if [ ! -r $INSTALL ] ; then
    echo "Uninstallation failed. No installation found at $INSTALL."
    exit -1
fi

if ! rm -rf $INSTALL ; then
    echo "Uninstallation failed. You may not have sufficient rights to delete $INSTALL."
    exit -1
fi

if test yes = yes ; then
    if ! rm -rf /etc/armagetron ; then
	echo "Uninstallation failed. You may not have sufficient rights to delete $INSTALL."
	exit -1
    fi
fi

rm -f $BIN/armagetronad
rm -f $BIN/armagetronad_stat

echo "Uninstallation complete!"


