~george-edison55/charms/precise/python-django/fix-readme

« back to all changes in this revision

Viewing changes to hooks/website-relation-joined

  • Committer: Patrick Hetu
  • Date: 2012-07-09 16:00:51 UTC
  • Revision ID: patrick.hetu@gmail.com-20120709160051-y1uaynd5812kxc1d
re-introduce website relation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
set -e
 
3
 
 
4
unit_name=${JUJU_UNIT_NAME//\//-}
 
5
 
 
6
if [ -e /etc/gunicorn.d/${unit_name}.conf ]; then
 
7
 
 
8
    bind_line=$(grep "bind=0.0.0.0:" /etc/gunicorn.d/${unit_name}.conf)
 
9
    PORT=$(echo ${bind_line} | grep -o ":[0-9]*" | sed -e "s/://")
 
10
 
 
11
    juju-log "PORT=${PORT}"
 
12
 
 
13
    relation-set port="${PORT}" hostname=`unit-get private-address`
 
14
fi