From 6a1a76ff3bcd89b4b0e435c93f3ba7954ca6a547 Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Wed, 26 Apr 2017 01:12:08 +0300 Subject: [PATCH] add lamassu-nuke-db --- bin/lamassu-nuke-db | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 bin/lamassu-nuke-db diff --git a/bin/lamassu-nuke-db b/bin/lamassu-nuke-db new file mode 100755 index 00000000..413196cd --- /dev/null +++ b/bin/lamassu-nuke-db @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -e + +if [ "$(whoami)" != "root" ]; then + echo -e "This script has to be run as \033[1mroot\033[0m user" + exit 3 +fi + +read -p "This will DELETE ALL YOUR DATA! Sure? (y/n) " answer +case ${answer:0:1} in + y|Y ) + echo "Deleting database..." + su -l postgres <