~onlineservices-charmers/charms/precise/gunicorn/trunk

« back to all changes in this revision

Viewing changes to hooks/website-relation-joined

  • Committer: Patrick Hetu
  • Date: 2012-07-06 16:08:59 UTC
  • Revision ID: patrick.hetu@gmail.com-20120706160859-j286siiq0cfdxi1b
be sure to use the gunicorn port in website relation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
 
relation-set port=80 hostname=`hostname -f`
 
2
set -e
 
3
 
 
4
unit_name=${JUJU_REMOTE_UNIT//\//-}
 
5
 
 
6
bind_line=$(grep "bind=0.0.0.0:" /etc/gunicorn.d/${unit_name}-${JUJU_RELATION_NAME}.conf)
 
7
PORT=$(echo ${bind_line} | grep -o "[0-9]*")
 
8
 
 
9
relation-set port=$PORT hostname=`unit-get private-address`