Changeset 4894


Ignore:
Timestamp:
May 24, 2017, 1:54:25 PM (2 years ago)
Author:
joamuran
Message:

fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-jocomunico/trunk/fuentes/debian/lliurex-jocomunico.postinst

    r4893 r4894  
    99}
    1010
     11function configureDataBase(){
     12    echo "Configuring Jocomunico Database info"
     13   
     14    DB_CONF_FILE=/opt/jocomunico/application/config/database.php;
     15    DATABASE=jocomunicolliureX;
     16    DB_TMP=/tmp/db_tmp.php;
     17
     18    # call to setvars
     19    setvars /root/.my.cnf  | grep "\[mysql\]" > /tmp/mysqldatainfo
     20
     21    # source from mysqldatainfo
     22    . /tmp/mysqldatainfo
     23
     24    sed "s/'password' => 'root'/'password' => '$password'/;s/'database' => 'jocomunicoapp'/'database' => '$DATABASE'/;s/'username' => 'root'/'username' => '$user'/" $DB_CONF_FILE >  $DB_TMP
     25       
     26    # When finished, let's set right files
     27    rm /tmp/mysqldatainfo
     28    cp $DB_TMP $DB_CONF_FILE
     29    rm $db_TMP
     30}
    1131
    1232case $1 in
    1333       
    1434        configure)
    15    
    16         #sed "s/'password' => 'root'/'password' => 'llx_pass'/;s/'database' => 'jocomunicoapp'/'database' => 'jocomunicolliureX'/;" /srv/svn/xenial/lliurex-jocomunico/trunk/fuentes/lliurex-jocomunico.install/opt/jocomunico/application/config/database.php > eixida.txt
    17    
    18         DB_CONF_FILE=/opt/jocomunico/application/config/database.php;
    19         DATABASE=jocomunicolliureX;
    20         DB_TMP=/tmp/db_tmp.php;
    21 
    22         # call to setvars
    23         setvars /root/.my.cnf  | grep "\[mysql\]" > /tmp/mysqldatainfo
    24 
    25         # source from mysqldatainfo
    26         . /tmp/mysqldatainfo
    27 
    28         sed "s/'password' => 'root'/'password' => '$password'/;s/'database' => 'jocomunicoapp'/'database' => '$DATABASE'/;s/'username' => 'root'/'username' => '$user'/" $DB_CONF_FILE >  $DB_TMP
    29        
    30         # When finished, let's set right files
    31         rm /tmp/mysqldatainfo
    32         cp $DB_TMP $DB_CONF_FILE
    33         rm $db_TMP
    34 
    35    
    3635   
    3736                # mp3 dirs permissions
     
    7271                lliurex-sgbd --upgrade jocomunicolliureX
    7372        fi
     73       
     74        # Setting up database
     75        configureDataBase
     76       
    7477        ;;
    7578       
Note: See TracChangeset for help on using the changeset viewer.