#!/usr/bin/env bash

if [ ! $UID -eq 0 ]
then
    echo "You should run this script as root"
    exit 1
fi

echo ""
echo "This script will remove the opengnsys database"
echo "All data will be removed."

echo ""
echo "Continue? (Y/n)"
read cont
case $cont in n|N)
    echo "Doing nothing, bye"
    exit 1
    ;;
esac

su -c "dropdb opengnsys" postgres
su -c "dropuser opengnsys" postgres
