~george-edison55/charms/oneiric/thinkup/update-to-1-0-2

« back to all changes in this revision

Viewing changes to hooks/db-relation-changed

  • Committer: Nathan Osman
  • Date: 2011-11-21 23:09:06 UTC
  • Revision ID: admin@quickmediasolutions.com-20111121230906-mgwx2rbkz7dsla2k
Removed sed and switched to a PHP script for updating the config file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
# Update the data in the configuration file
25
25
juju-log "Updating configuration file"
26
 
sed -i -e "s/^\\\$THINKUP_CFG\['db_host'\](\s*)\=.*/\$THINKUP_CFG['db_host']$1= '${DB_HOST}';/" -e "s/^\\\$THINKUP_CFG\['db_user'\](\s*)\=.*/\$THINKUP_CFG['db_user']$1= '${DB_USER}';/" -e "s/^\\\$THINKUP_CFG\['db_password'\](\s*)\=.*/\$THINKUP_CFG['db_password']$1= '${DB_PASS}';/" -e "s/^\\\$THINKUP_CFG\['db_name'\](\s*)\=.*/\$THINKUP_CFG['db_name']$1= '${DATABASE}';/" /var/www/config.inc.php
 
26
update_thinkup_config <<EOD
 
27
db_host=$DB_HOST
 
28
db_user=$DB_USER
 
29
db_password=$DB_PASS
 
30
db_name=$DATABASE
 
31
EOD
27
32
 
28
33
# Execute the SQL that creates the tables
29
34
juju-log "Creating database tables"