[Backport] Prevent accidental deletions of the database
parent
b6839a9505
commit
70ba7af395
|
@ -1,6 +1,25 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# For postgresql
|
show_answer=true
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-y)
|
||||||
|
show_answer=false
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if $show_answer ; then
|
||||||
|
echo "WARNING!! This script REMOVE your Taiga's database and you LOSE all the data."
|
||||||
|
read -p "Are you sure you want to delete all data? (Pres Y to continue): " -n 1 -r
|
||||||
|
echo # (optional) move to a new line
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]] ; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "-> Remove taiga DB"
|
echo "-> Remove taiga DB"
|
||||||
dropdb taiga
|
dropdb taiga
|
||||||
echo "-> Create taiga DB"
|
echo "-> Create taiga DB"
|
||||||
|
|
Loading…
Reference in New Issue