#!/bin/sh
#################################################
# Script de desinstalacion 
#------------------------------------------------
# (C) Microbotica, S.L. Licencia GPL
#################################################

DIRDESINSTALA="/usr/local"
name=ras     # Nombre de la aplicacion

echo ------------------------------------------------
echo - DESINSTALACION DE $name        
echo ------------------------------------------------
echo
#----------------------------------------------
# Comprobar si se tiene privilegios de root  
#----------------------------------------------
if [ $(id | grep -c root) == 0 ]
then
  echo "NO TIENES PRIVILEGIOS DE ROOT"
  exit 1
fi

#-------------------------------------------------
# Comprobar si existe el paquete indicado
#-------------------------------------------------
if [ -d $DIRDESINSTALA ]
then
  rm -f $DIRDESINSTALA/bin/$name
  rm -f $DIRDESINSTALA/man/man1/$name.1
else
  echo "No existe el directorio: "$DIRDESINSTALA
  exit 1
fi

echo "DESINSTALACION DE $name COMPLETADA"
