~marcoceppi/charms/precise/spip/tests

« back to all changes in this revision

Viewing changes to hooks/nfs-relation-changed

  • Committer: Pierre Amadio
  • Date: 2012-11-21 12:27:50 UTC
  • Revision ID: pierre.amadio@canonical.com-20121121122750-7jdvdzn2ajm2o8en
should use several directory in the shared space when using nfs

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
MOUNT_PATH=$mountpoint
29
29
EOF
30
30
 
 
31
# We wants several directory to be hosted on a shared fs:
 
32
# /var/www/spip/IMG
 
33
# /var/www/spip/plugins
 
34
# /var/www/spip/squelettes
 
35
 
 
36
for i in plugins squelettes IMG ; do
 
37
    if [ ! -d /var/www/spip/$i ]; then
 
38
        mkdir /var/www/spip/$i ;
 
39
    fi
 
40
    chown -R www-data /var/www/spip/$i ;
 
41
done
 
42
 
31
43
#Let s make a backup copy of things:
32
44
d=`date +"%s"` 
33
45
mkdir  /tmp/$d
34
 
mv /var/www/spip/IMG/* /tmp/$d
 
46
for i in plugins squelettes IMG ; do
 
47
    mkdir /tmp/$d/$i ;
 
48
    mv /var/www/spip/$i /tmp/$d/ ;
 
49
done
 
50
 
35
51
#Now we mount the nfs share.
36
 
juju-log "mount -t nfs  $host:$mountpoint /var/www/spip/IMG/"
37
 
mount -t nfs  $host:$mountpoint /var/www/spip/IMG/
 
52
mkdir -p /mnt/spip-nfs
 
53
 
 
54
juju-log "mount -t nfs  $host:$mountpoint /mnt/spip-nfs"
 
55
mount -t nfs  $host:$mountpoint /mnt/spip-nfs
 
56
 
 
57
for i in plugins squelettes IMG ; do
 
58
    mv /tmp/$d/$i /mnt/spip-nfs/;
 
59
    chown -R www-data /mnt/spip-nfs;
 
60
    ln -s /mnt/spip-nfs/$i/ /var/www/spip/;
 
61
done
 
62
 
 
63
 
38
64
#We copy back all the stuff that was present locally.
39
 
mv /tmp/$d/* /var/www/spip/IMG/
 
65
#mv /tmp/$d/* /var/www/spip/IMG/
40
66
#and we chmod it back to www-data
41
 
chown -R www-data /var/www/spip/IMG/
 
 
b'\\ No newline at end of file'
 
67
#chown -R www-data /var/www/spip/IMG/
 
 
b'\\ No newline at end of file'