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

« back to all changes in this revision

Viewing changes to hooks/config-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:
10
10
CACHE=`config-get cache`
11
11
CACHE_LIFETIME=`config-get cache-lifetime`
12
12
 
13
 
# Write the configuration file to disk
14
13
juju-log "Updating configuration file"
15
 
sed -i -e "s/^\\\$THINKUP_CFG\['app_title'\](\s*)\=.*/\$THINKUP_CFG['app_title']$1= '${TITLE}';/" -e "s/^\\\$THINKUP_CFG\['timezone'\](\s*)\=.*/\$THINKUP_CFG['timezone']$1= '${TIMEZONE}';/" -e "s/^\\\$THINKUP_CFG\['cache_pages'\](\s*)\=.*/\$THINKUP_CFG['cache_pages']$1= ${CACHE};/"-e "s/^\\\$THINKUP_CFG\['cache_lifetime'\](\s*)\=.*/\$THINKUP_CFG['cache_lifetime']$1= '${CACHE_LIFETIME}';/" /var/www/config.inc.php
 
14
update_thinkup_config <<EOD
 
15
app_title="$TITLE"
 
16
timezone="$TIMEZONE"
 
17
cache_pages=$CACHE
 
18
cache_lifetime=$CACHE_LIFETIME
 
19
EOD