diff options
author | M.Gergo | 2018-03-28 20:48:05 +0200 |
---|---|---|
committer | M.Gergo | 2018-03-28 20:48:05 +0200 |
commit | cf30dceb15fa65f503c2a3f31f95b08ce1c65d35 (patch) | |
tree | 3d51eabdf4c9bc7a3daca03d265c052fb0601ac2 /mayor-installer/install.d/35createdatabases.sh | |
parent | 20a9412f1f5bc7b7e40ffb24e262cdf20420983c (diff) | |
download | mayor-cf30dceb15fa65f503c2a3f31f95b08ce1c65d35.tar.gz mayor-cf30dceb15fa65f503c2a3f31f95b08ce1c65d35.zip |
installer javítás 1
Diffstat (limited to 'mayor-installer/install.d/35createdatabases.sh')
-rwxr-xr-x | mayor-installer/install.d/35createdatabases.sh | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/mayor-installer/install.d/35createdatabases.sh b/mayor-installer/install.d/35createdatabases.sh index d44d28e4..718ca3c2 100755 --- a/mayor-installer/install.d/35createdatabases.sh +++ b/mayor-installer/install.d/35createdatabases.sh @@ -40,13 +40,13 @@ if [ ! -e $MAYORDIR/log/mayor-base.rev ]; then echo " Hiányzó mayor-base.rev file"; if [ -e $MAYORDIR/log/revision ]; then - IREV=`cat $MAYORDIR/log/revision` + IREV=$(cat $MAYORDIR/log/revision) else IREV=""; fi else cp $MAYORDIR/log/mayor-base.rev $MAYORDIR/log/revision - IREV=`cat $MAYORDIR/log/revision` + IREV=$(cat $MAYORDIR/log/revision) fi echo " Az aktuális revision: ${IREV}" @@ -60,36 +60,36 @@ fi echo " SQL fileok létrehozása... " mkdir -p $TMPDIR/mysql cd $TMPDIR/mysql -DB=`grep db $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USER=`grep user $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g"` -PW=`grep pw $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g"` +DB=$(grep db $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g") +USER=$(grep user $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g") +PW=$(grep pw $MAYORDIR/config/main-config.php | sed -e "s/$.*=\ *['|\"]//g" -e "s/['|\"];//g") cat $MAYORDIR/install/base/mysql/mayor-login.sql | sed -e "s/%MYSQL_LOGIN_DB%/$DB/g" -e "s/%MYSQL_LOGIN_USER%/$USER/g" \ -e "s/%MYSQL_LOGIN_PW%/$PW/g" > mayor-login.sql -DB=`grep db $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -USER=`grep user $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -PW=`grep pw $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +DB=$(grep db $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") +USER=$(grep user $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") +PW=$(grep pw $MAYORDIR/config/parent-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") cat $MAYORDIR/install/base/mysql/mayor-auth.sql | sed -e "s/%MYSQL_AUTH_DB%/$DB/g" -e "s/%MYSQL_AUTH_USER%/$USER/g" \ -e "s/%MYSQL_AUTH_PW%/$PW/g" > mayor-parent.sql -DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -USER=`grep 'mysql user' $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` -PW=`grep pw $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +DB=$(grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") +USER=$(grep 'mysql user' $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") +PW=$(grep pw $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") cat $MAYORDIR/install/base/mysql/mayor-auth.sql | sed -e "s/%MYSQL_AUTH_DB%/$DB/g" -e "s/%MYSQL_AUTH_USER%/$USER/g" \ -e "s/%MYSQL_AUTH_PW%/$PW/g" > mayor-private.sql -DB=`grep db $MAYORDIR/config/module-naplo/config.php | grep naplo_base | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USER=`egrep 'userWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -USERREAD=`egrep 'userRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -PW=`egrep 'pwWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` -PWREAD=`egrep 'pwRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g"` +DB=$(grep db $MAYORDIR/config/module-naplo/config.php | grep naplo_base | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +USER=$(egrep 'userWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +USERREAD=$(egrep 'userRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +PW=$(egrep 'pwWrite.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") +PWREAD=$(egrep 'pwRead.*=' $MAYORDIR/config/module-naplo/config.php | sed -e "s/^.*=\ *['|\"]//g" -e "s/['|\"];//g") cat $MAYORDIR/install/module-naplo/mysql/base.sql | sed -e "s/%MYSQL_NAPLO_DB%/$DB/g" -e "s/%MYSQL_NAPLO_USER%/$USER/g" \ -e "s/%MYSQL_NAPLO_PW%/$PW/g" -e "s/%MYSQL_NAPLO_USER_READ%/$USERREAD/g" \ -e "s/%MYSQL_NAPLO_PW_READ%/$PWREAD/g" > base.sql -DB=`grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g"` +DB=$(grep db $MAYORDIR/config/private-conf.php | sed -e "s/^.*>\ *['|\"]//g" -e "s/['|\"],//g") cat $MAYORDIR/install/base/mysql/private-users.sql | sed -e "s/%MYSQL_PRIVATE_DB%/$DB/g" > private-users.sql cat $MAYORDIR/install/module-naplo/mysql/naplo-users.sql | sed -e "s/%MYSQL_PRIVATE_DB%/$DB/g" > naplo-users.sql echo " A létrejött sql fileok:" -FILES=`ls *.sql` +FILES=$(ls *.sql) for f in $FILES do echo " * ${f}"; @@ -100,8 +100,11 @@ echo -e "\n" read -p " A mysql root jelszó (a begépelt szöveg nem látszik!): " -s MYSQLROOTPW + if [ ! -e $MAYORDIR/config/main.conf ]; then cat $MAYORDIR/config/main.conf.example | sed s/%SQLPW%/$MYSQLROOTPW/ > $MAYORDIR/config/main.conf +# BDIR=$(echo $MAYORDIR | sed -e 's:\/:\\\/:g') +# sed -e "s/BASEDIR=\"\/var\/mayor\"/BASEDIR=\"$BDIR\"/g" -i $MAYORDIR/config/main.conf chmod 600 $MAYORDIR/config/main.conf fi |