Skip to content

Commit

Permalink
Fix credentials and indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed May 27, 2015
1 parent 14112e1 commit ffc5fa8
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions misc/tools/install.sh
Expand Up @@ -179,13 +179,13 @@ echo
echo "installing dependencies..."

pushd "$vz_dir"
"$COMPOSER" install --no-dev
"$COMPOSER" install --no-dev

echo
ask "install server-side graph generation (jpgraph, not required for frontend)?" n
if [ "$REPLY" == "y" ]; then
"$COMPOSER" require --update-no-dev jpgraph/jpgraph:dev-master
fi
echo
ask "install server-side graph generation (jpgraph, not required for frontend)?" n
if [ "$REPLY" == "y" ]; then
"$COMPOSER" require --update-no-dev jpgraph/jpgraph:dev-master
fi
popd

###############################
Expand All @@ -207,18 +207,24 @@ fi
echo
ask "create volkszaehler.org database?" y
if [ "$REPLY" == "y" ]; then
get_db_admin
get_db_name

echo "creating database $db_name..."
mysql -h"$db_host" -u"$db_admin_user" -p"$db_admin_pass" -e 'CREATE DATABASE `'"$db_name"'`'
pushd "$vz_dir"
php misc/tools/doctrine orm:schema-tool:create
php misc/tools/doctrine orm:generate-proxies
php misc/tools/doctrine orm:schema-tool:create
php misc/tools/doctrine orm:generate-proxies
popd
fi

###############################
echo
ask "create volkszaehler.org database user?" y
if [ "$REPLY" == "y" ]; then
get_db_admin
get_db_name

echo "creating db user $db_user with proper rights..."
mysql -h"$db_host" -u"$db_admin_user" -p"$db_admin_pass" <<-EOF
CREATE USER '$db_user'@'$db_host' IDENTIFIED BY '$db_pass';
Expand All @@ -236,7 +242,7 @@ if [ "$REPLY" == "y" ]; then
get_db_admin
get_db_name

echo "adding db user $db_user delete rights..."
echo "granting db user $db_user delete rights..."
mysql -h"$db_host" -u"$db_admin_user" -p"$db_admin_pass" <<-EOF
GRANT DELETE ON $db_name.* TO '$db_user'@'$db_host';
EOF
Expand All @@ -247,9 +253,9 @@ ask "insert demo data in to database?" n
if [ "$REPLY" == "y" ]; then
get_db_admin
get_db_name

cat "$vz_dir/misc/sql/demo/entities.sql" "$vz_dir/misc/sql/demo/properties.sql" "$vz_dir/misc/sql/demo/data-demoset1.sql" |
mysql -h"$db_host" -u"$db_admin_user" -p"$db_admin_pass" "$db_name"
fi

cleanup

0 comments on commit ffc5fa8

Please sign in to comment.