File: mount.sh

package info (click to toggle)
bcbio 1.2.9-4
  • links: PTS, VCS
  • area: contrib
  • in suites: sid
  • size: 36,792 kB
  • sloc: python: 45,766; sh: 209; makefile: 159; xml: 129
file content (33 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#source this file.


_BUCKET="testbcbio"
checkmounted(){ grep -s "$1" "/proc/mounts";}


if checkmounted "$_BUCKET"; then
	echo "S3 bucket is mounted."
else 
    echo "Starting syslogd..."
    service rsyslog start
	echo "Mounting the bucket..."
	cmd="goofys --sse $_BUCKET /mnt/$_BUCKET"
	echo $cmd
	$cmd
    sleep 1
	if checkmounted "$_BUCKET"; then
		echo "Successfully mounted S3 bucket."
	else
		echo "Something went wrong with the mount."
		echo "That's all I know:"
		sudo grep "fuse\|goofys" /var/log/syslog | tail
	fi
fi

export BCBIO_WORKDIR=/mnt/$_BUCKET/testworkdir
echo "BCBIO_WORKDIR is now $BCBIO_WORKDIR"

deactivate () {
	echo "BCBIO_WORKDIR is no longer $BCBIO_WORKDIR"
	unset BCBIO_WORKDIR
}