Changeset 487


Ignore:
Timestamp:
02/22/06 00:23:18 (7 years ago)
Author:
anarcat
Message:

[project @ alternc: changeset 2005-01-17 22:23:30 by anarcat]
edit alternc.conf in postinst and put the proper username/password in
local.sh Closes: #306, #327

Original author: anarcat
Date: 2005-01-17 22:23:30

File:
1 edited

Legend:

Unmodified
Added
Removed
  • debian/postinst

    r414 r487  
    1 #!/bin/sh 
     1#!/bin/sh -x 
    22 
    33set -e 
     
    2020#     installation fails and the `postinst' is called with `abort-upgrade', 
    2121#     `abort-remove' or `abort-deconfigure'. 
     22 
     23alternc_conf=/etc/alternc/alternc.conf 
     24 
     25# helper to change variables in alternc.conf 
     26change_var () { 
     27    varname=$1; shift; 
     28    value=$1; shift; 
     29 
     30    echo "changing var $varname to $value" 
     31    sed -e "s#^${varname}=.*\$#${varname}=${value}#" < $alternc_conf > $alternc_conf.$$ && \ 
     32        mv $alternc_conf.$$ $alternc_conf 
     33} 
    2234 
    2335case "$1" in 
     
    4254    "alternc/data_part DATA_PART" \ 
    4355    "alternc/mysql/host MYSQL_HOST" \ 
    44     "alternc/mysql/rootuser MYSQL_USER" \ 
    45     "alternc/mysql/rootpassword MYSQL_PASS" \ 
    4656    "alternc/mysql/db MYSQL_DATABASE" \ 
    47     "alternc/mysql/user ROOT_USER" \ 
    48     "alternc/mysql/password ROOT_PASS" 
     57    "alternc/mysql/user MYSQL_USER" \ 
     58    "alternc/mysql/password MYSQL_PASS" 
    4959    do 
    5060      skip=0 
     
    6676    #db_get alternc/ns2 
    6777 
     78    if [ -e /etc/alternc/local.sh ]; then 
     79      # source local.sh variables 
     80      . /etc/alternc/local.sh 
     81    fi 
     82 
     83    # 
     84    # rewriting alternc.conf 
     85    # 
     86    change_var "mx" "$DEFAULT_MX" 
     87    change_var "DATA_PART" "$DATA_PART" 
     88    change_var "dbhost" "$MYSQL_HOST" 
     89    change_var "dbuser" "$MYSQL_USER" 
     90    change_var "dbpwd" "$MYSQL_PASS" 
     91    change_var "dbname" "$MYSQL_DATABASE" 
     92    change_var "myip" "$DEFAULT_IP" 
     93 
     94    echo "The following variables have been left untouched in alternc.conf" 
     95    echo "You will have to review those before manually launching alternc.install" 
     96 
     97    cat <<EOF 
     98    # variables not treated here (debconf variable) 
     99    # monitor_ip 
     100    # fqdn (desktopname) 
     101    # hosting (hostingname) 
     102    # bind_internal 
     103    # ns1, ns2 (idem) 
     104    # dnsip 
     105    # myrandom 
     106    # mynetwork 
     107EOF 
     108 
     109    echo "checking for upgrades" 
    68110    /usr/share/alternc/install/upgrade_check.sh $2 
    69111 
Note: See TracChangeset for help on using the changeset viewer.