From 5f9e688467c88b83151d0e6feb9f6dad95b0892c Mon Sep 17 00:00:00 2001 From: Brendan McCollam Date: Tue, 24 Mar 2015 10:27:49 -0500 Subject: [PATCH] Sets system-wide locale settings to en_US.UTF-8 and grants APP_DB_USER the CREATEDB privilege --- Vagrant-setup/bootstrap.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Vagrant-setup/bootstrap.sh b/Vagrant-setup/bootstrap.sh index cdb4ac9..967586c 100755 --- a/Vagrant-setup/bootstrap.sh +++ b/Vagrant-setup/bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e # Edit the following to change the name of the database user that will be created: APP_DB_USER=myapp @@ -13,6 +13,12 @@ PG_VERSION=9.3 ########################################################### # Changes below this line are probably not necessary ########################################################### + +# Make sure we get UTF-8 +locale-gen en_US.UTF-8 +update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 +source /etc/default/locale + print_db_usage () { echo "Your PostgreSQL database has been setup and can be accessed on your local machine on the forwarded port (default: 15432)" echo " Host: localhost" @@ -83,7 +89,7 @@ service postgresql restart cat << EOF | su - postgres -c psql -- Create the database user: -CREATE USER $APP_DB_USER WITH PASSWORD '$APP_DB_PASS'; +CREATE USER $APP_DB_USER WITH CREATEDB PASSWORD '$APP_DB_PASS'; -- Create the database: CREATE DATABASE $APP_DB_NAME WITH OWNER=$APP_DB_USER