Changeset 999

Show
Ignore:
Timestamp:
04/08/06 00:17:05 (2 years ago)
Author:
joe
Message:

Modification de l'installation pour tenir compte du nouveau mysql.cnf. (#318 partie 2)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/debian/postinst

    r951 r999  
    77 
    88CONFIGFILE="/etc/alternc/local.sh" 
     9MYSQLCONFIG="/etc/alternc/mysql.cnf" 
    910 
    1011update_var() { 
     
    7778DEFAULT_MX="" 
    7879 
    79 # MySQL configuration 
     80# Starting with 0.9.5, the MySQL configuration for the support scripts 
     81# is stored in /etc/alternc/mysql.cnf 
    8082MYSQL_HOST="" 
    8183MYSQL_DATABASE="" 
     
    122124    sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp 
    123125    mv -f $CONFIGFILE.tmp $CONFIGFILE 
     126 
     127    cat > $MYSQLCONFIG.tmp <<EOF 
     128# This file is automatically generated 
     129# and will be overwritten on upgrade. 
     130[client] 
     131EOF 
     132    chown root:www-data $MYSQLCONFIG.tmp 
     133    chmod 640  $MYSQLCONFIG.tmp 
     134 
     135    db_get alternc/mysql/db 
     136    echo "database = $RET" >> $MYSQLCONFIG.tmp 
     137    db_get alternc/mysql/user 
     138    echo "user = $RET" >> $MYSQLCONFIG.tmp 
     139    db_get alternc/mysql/password 
     140    echo "pass = $RET" >> $MYSQLCONFIG.tmp 
     141    db_get alternc/mysql/host 
     142    echo "host = $RET" >> $MYSQLCONFIG.tmp 
     143 
     144    mv -f $MYSQLCONFIG.tmp $MYSQLCONFIG 
    124145 
    125146    # forget the password 
  • trunk/install/upgrades/0.9.5.sh

    r998 r999  
    1212 
    1313if [ ! -e /etc/alternc/mysql.cnf ]; then 
    14     grep '^MYSQL_.*$' /etc/alternc/local.sh | sed -e '1 i[client]' -e '/^MYSQL_HOST.*$/ d' -e 's/^MYSQL_CLIENT/MYSQL_HOST/' -e 's/"//g' -e 's/=/ = /g' -e 's/MYSQL_//g' -e 's/^[^=]*/\L\0/' > "$TMP" 
     14    grep '^MYSQL_.*$' /etc/alternc/local.sh | sed -e '1 i# This file is automatically generated\n# and will be overwritten on upgrade.\n[client]' -e '/^MYSQL_CLIENT.*$/ d' -e 's/"//g' -e 's/=/ = /g' -e 's/MYSQL_//g' -e 's/^[^=]*/\L\0/' > "$TMP" 
    1515 
    1616    chgrp www-data "$TMP"