#!/bin/sh

echo "(!!!)"
echo "(!!!) This utility will delete all Gogs databases, repositories and logs"
echo "(!!!) without affecting Gogs installation itself."
echo "(!!!) Proceed with caution!"
echo "(!!!)"
echo "(!!!) Hit Ctrl-C now if in doubt."
echo "(!!!)"

while true; do
  read -p "This will delete all Gogs databases, are you sure you want to proceed? (yes/no) " yn
  case $yn in
    [Yy]* ) break;;
    [Nn]* ) exit;;
    * ) echo "Please answer yes or no.";;
  esac
done

rm -rf /var/db/gogs/*/* /var/log/gogs/* /var/log/gogs.log
