From: Clinton Ebadi Date: Wed, 23 Feb 2011 12:51:08 +0000 (-0500) Subject: Call `create-user-database' with $USER and not $PATHBITS X-Git-Url: http://git.hcoop.net/clinton/scripts.git/commitdiff_plain/58df4059b531d354b1b81c641a899000b493646d Call `create-user-database' with $USER and not $PATHBITS --- diff --git a/create-user b/create-user index f7f9f39..f9c49c0 100755 --- a/create-user +++ b/create-user @@ -259,7 +259,7 @@ else fi # Create database tablespaces -execute_on_fritz /afs/hcoop.net/common/etc/scripts/create-user-database $PATHBITS +execute_on_fritz /afs/hcoop.net/common/etc/scripts/create-user-database $USER # # Mount points for backup volumes diff --git a/create-user-database b/create-user-database index 4725bd8..99293b0 100755 --- 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