install script fixes

- removed bad tab from vz dir test
- use the actually entered database name, not hard coded volkszaehler
- git URLs are now configured at top of the script
This commit is contained in:
root 2010-12-10 19:05:22 +08:00 committed by Steffen Vogel
parent 4b0142dfcf
commit 9419d91930

13
share/tools/install.sh Normal file → Executable file
View file

@ -8,6 +8,9 @@ db_host=localhost
set -e
shopt -s nocasematch
doctrine_git=git://github.com/doctrine/doctrine2.git
vz_git=git://github.com/volkszaehler/volkszaehler.org.git
ask() {
question=$1
default=$2
@ -43,7 +46,7 @@ test -e "$dtdir" && ask "$dtdir already exists. overwrite?" n
if [ "$REPLY" == 'y' ]; then
echo "installing doctrine into $dtdir"
mkdir -p $dtdir
git clone git://github.com/doctrine/doctrine2.git $dtdir
git clone $doctrine_git $dtdir
pushd $dtdir
git submodule init
git submodule update
@ -63,11 +66,11 @@ ask "volkszaehler path?" /var/www/vz
vzdir=$REPLY
REPLY=y
test -e "$vzdir " && ask "$vzdir already exists. overwrite?" n
test -e "$vzdir" && ask "$vzdir already exists. overwrite?" n
if [ "$REPLY" == 'y' ]; then
echo "installing volkszaehler.org into $vzdir"
mkdir -p $vzdir
git clone git://github.com/volkszaehler/volkszaehler.org.git $vzdir
git clone $vz_git $vzdir
pushd $vzdir/backend/lib/vendor
ln -s $dtdir/lib/Doctrine/ .
@ -102,8 +105,8 @@ ask "create database?" y
if [ "$REPLY" == "y" ]; then
get_admin
echo creating tables...
mysql -h$db_host -u$db_admin_user -p$db_admin_pass -e 'CREATE DATABASE `volkszaehler`'
echo creating database $db_name...
mysql -h$db_host -u$db_admin_user -p$db_admin_pass -e 'CREATE DATABASE `'$db_name'`'
pushd $vzdir
php backend/bin/doctrine orm:schema-tool:create
popd