github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/acceptancetests/repository/xenial/wordpress/hooks/nfs-relation-changed (about) 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