~sinzui/juju-ci-tools/repository

« back to all changes in this revision

Viewing changes to xenial/wordpress/hooks/nfs-relation-changed

  • Committer: Curtis Hovey
  • Date: 2015-11-06 15:43:36 UTC
  • Revision ID: curtis@hovey.name-20151106154336-soncn5peue27jtr0
Added xenial.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
set -eu
 
4
 
 
5
juju-log "We've got a mount"
 
6
source inc/common
 
7
 
 
8
options=`relation-get options`
 
9
mountpoint=`relation-get mountpoint`
 
10
fstype=`relation-get fstype`
 
11
host=`relation-get private-address`
 
12
 
 
13
if [ -z "$fstype" ] ; then
 
14
        juju-log "Going to wait for some real data"
 
15
    exit 0
 
16
fi
 
17
 
 
18
if [ ! -z "$options" ]; then
 
19
    options="-o $options"
 
20
fi
 
21
 
 
22
# Write this out to our .nfs-mount file
 
23
cat > .nfs-mount <<EOF
 
24
#!/bin/bash
 
25
MOUNT_TYPE=$fstype
 
26
MOUNT_OPS=$options
 
27
MOUNT_SERVER=$host
 
28
MOUNT_PATH=$mountpoint
 
29
 
 
30
EOF
 
31
 
 
32
. hooks/config-changed