diff --git a/scripts/db/setup-postgres.sh b/scripts/db/setup-postgres.sh new file mode 100644 index 0000000..40917bd --- /dev/null +++ b/scripts/db/setup-postgres.sh @@ -0,0 +1,8 @@ + +$INTERACTIVE && read -p "Create user 'sik' in PostgresSQL db (needs sudo) [y/n]?" -n 1 -r || REPLY="n" +echo "" + +if [[ $REPLY =~ ^[Yy]$ ]] +then + sudo -u postgres psql < "$PWD/init.sql" +fi \ No newline at end of file diff --git a/setup.sh b/setup.sh index f97b9b5..53c1a71 100755 --- a/setup.sh +++ b/setup.sh @@ -27,14 +27,6 @@ then exit 0 fi -$INTERACTIVE && read -p "Create user 'sik' in database (needs sudo) [y/n]?" -n 1 -r || REPLY="n" -echo "" - -if [[ $REPLY =~ ^[Yy]$ ]] -then - sudo -u postgres psql < "$PWD/scripts/db/init.sql" -fi - $INTERACTIVE && read -p "Is virtualenv activated? [y/n]" -n 1 -r || REPLY="y" echo ""