#!/usr/bin/bash

echo "YOU ARE ABOUT TO DESTROY THE DATABASE AND RESET YOUR EXTERNAL CRYPTOBONE"
echo -n "DO YOU REALLY WANT TO DO THIS ?  : "
read RES

/usr/bin/echo 
if [[ x${RES}x = xyesx ]]; then
     /usr/sbin/userdel cryptobone 2>/dev/null
     /usr/bin/rm -rf /usr/lib/cryptobone/ext/cryptobone
     /usr/bin/rm -f /usr/lib/cryptobone/ext/masterkey
     /usr/bin/rm -f /usr/lib/cryptobone/ext/masterkey.hash
     /usr/bin/rm -f /usr/lib/cryptobone/ext/EXTERN.local.hash
     /usr/bin/rm -f /usr/lib/cryptobone/ext/database
     /usr/bin/rm -f /usr/lib/cryptobone/ext/database.back
     /usr/bin/rm -f /etc/sudoers.d/externalcryptobone
     # and finally 
     /usr/bin/rm -rf /dev/shm/EXRAM
     echo
     echo "Your external Crypto Bone is now destroyed."
else
     echo "Please answer yes if your are sure you want to destroy your external Crypto Bone."
fi 
exit 0
