X-Git-Url: https://git.hcoop.net/hcoop/scripts.git/blobdiff_plain/58df4059b531d354b1b81c641a899000b493646d..fa44e5b4fba097f4cdc4b139637d9aa303a2bbe7:/create-user-database diff --git a/create-user-database b/create-user-database index 99293b0..bc2ca60 100755 --- a/create-user-database +++ b/create-user-database @@ -11,13 +11,17 @@ PGDIR=$DBPATH/postgres MYSQLDIR=$DBPATH/mysql # Create postgres user and tablespace placeholder within volume +# FIXME: This assumes the status-quo of database accounts not being +# removed by destroy-user... if ! test -d $PGDIR; then mkdir -p $PGDIR chown postgres:postgres $PGDIR + sudo -u postgres psql -c "CREATE TABLESPACE \"user_$USER\" OWNER postgres LOCATION '$PGDIR'" template1 fi -sudo -u postgres psql -c "CREATE TABLESPACE user_$USER OWNER postgres LOCATION '$PGDIR'" template1 - # Create mysql user and databases placeholder within volume -mkdir -p $MYSQLDIR -chown mysql:mysql $MYSQLDIR \ No newline at end of file +# FIXME: Same as postgres... +if ! test -d $MYSQLDIR; then + mkdir -p $MYSQLDIR + chown mysql:mysql $MYSQLDIR +fi \ No newline at end of file