X-Git-Url: http://git.hcoop.net/clinton/scripts.git/blobdiff_plain/82cda9f8fe4595f243af80a3acef7ea7e8d939a4..58df4059b531d354b1b81c641a899000b493646d:/create-user-database diff --git a/create-user-database b/create-user-database old mode 100644 new mode 100755 index 4725bd8..99293b0 --- a/create-user-database +++ b/create-user-database @@ -3,7 +3,9 @@ # DO NOT EXECUTE DIRECTLY # This is only to be executed by create-user -PATHBITS=$1 +USER=$1 +# (If it's not clear, for user fred, PATHBITS = f/fr/fred) +PATHBITS=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER DBPATH=/srv/databases/$PATHBITS PGDIR=$DBPATH/postgres MYSQLDIR=$DBPATH/mysql @@ -15,7 +17,6 @@ if ! test -d $PGDIR; then fi sudo -u postgres psql -c "CREATE TABLESPACE user_$USER OWNER postgres LOCATION '$PGDIR'" template1 -fi # Create mysql user and databases placeholder within volume mkdir -p $MYSQLDIR