adapted install script to new dir structure

added copyright notices
This commit is contained in:
Steffen Vogel 2010-12-27 23:15:43 +01:00
parent 2f3db93c35
commit 3dc45da8cd
2 changed files with 54 additions and 25 deletions

View file

@ -1,30 +1,33 @@
#!/bin/bash
#
# Copyright (c) 2010 by Justin Otherguy <justin@justinotherguy.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (either version 2 or
# version 3) as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# For more information on the GPL, please go to:
# http://www.gnu.org/copyleft/gpl.html
#
# This is a simple bash script to read Dallas 1-Wire sensors
# with digitemp and log their values to the volkszaehler project.
#
# call it with a cronjob similiar to this one:
#
# */5 * * * * ~/bin/log1wire.sh
# */5 * * * * ~/bin/log1wire.sh
#
# @copyright Copyright (c) 2010, The volkszaehler.org project
# @package controller
# @license http://www.opensource.org/licenses/gpl-license.php GNU Public License
# @author Steffen Vogel <info@steffenvogel.de>
#
##
# This file is part of volkzaehler.org
#
# volkzaehler.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# volkzaehler.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with volkszaehler.org. If not, see <http://www.gnu.org/licenses/>.
##
# configuration
#

View file

@ -1,6 +1,32 @@
#!/bin/bash
# Jakob Hirsch, 2010-11-20
#
# Installer
#
# For creating/updating the configuration/database
# and downloading of required libraries
# and configuration of of the PHP interpreter/webserver
#
# @copyright Copyright (c) 2010, The volkszaehler.org project
# @package tools
# @license http://www.opensource.org/licenses/gpl-license.php GNU Public License
# @author Jakob Hirsch
#
##
# This file is part of volkzaehler.org
#
# volkzaehler.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# volkzaehler.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with volkszaehler.org. If not, see <http://www.gnu.org/licenses/>.
##
# cannot handle other hosts right now
db_host=localhost
@ -72,13 +98,13 @@ if [ "$REPLY" == 'y' ]; then
mkdir -p $vzdir
git clone $vz_git $vzdir
pushd $vzdir/backend/lib/vendor
pushd $vzdir/lib/vendor
ln -s $dtdir/lib/Doctrine/ .
ln -s $dtdir/lib/vendor/Symfony/ .
popd
fi
config=$vzdir/backend/volkszaehler.conf.php
config=$vzdir/etc/volkszaehler.conf.php
############
echo
@ -95,7 +121,7 @@ if [ "$REPLY" == "y" ]; then
sed -e "s/^\(\$config\['db'\]\['user'\]\).*/\1 = '$db_user';/" \
-e "s/^\(\$config\['db'\]\['password'\]\).*/\1 = '$db_pass';/" \
-e "s/^\(\$config\['db'\]\['dbname'\]\).*/\1 = '$db_name';/" \
< $vzdir/backend/volkszaehler.conf.template.php \
< $vzdir/etc/volkszaehler.conf.template.php \
> $config
fi
@ -108,7 +134,7 @@ if [ "$REPLY" == "y" ]; then
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
php misc/tools/doctrine orm:schema-tool:create
popd
echo "creating db user $db_user with proper rights..."
@ -124,7 +150,7 @@ ask "insert demo data in to database?" n
if [ "$REPLY" == "y" ]; then
get_admin
get_db_name
cat $vzdir/share/sql/demo/entities.sql $vzdir/share/sql/demo/properties.sql $vzdir/share/sql/demo/data-demoset1.sql |
cat $vzdir/misc/sql/demo/entities.sql $vzdir/misc/sql/demo/properties.sql $vzdir/share/sql/demo/data-demoset1.sql |
mysql -h$db_host -u$db_admin_user -p$db_admin_pass $db_name
fi