summaryrefslogtreecommitdiffstats
path: root/perf-framework/acl
blob: c971fee4d6c06acab3f91cfcb2c1417b555c9815 (plain)
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
34
35
36
37
38
39
40
41
42
#!/bin/bash

source gf_perf_config

function usage()
{
	echo "Usage: $0 <on|off>"
	exit 1
}

function get_mount()
{
        brick=$1
	export_dir=$2
        ssh -l root $brick ls -d $export_dir > /dev/null
	if [ $? -ne 0 ]
	then
		echo "FATAL : Export directory does not exist. Exiting..."
		exit 1
	fi
        echo `ssh -l root $brick df -h $export_dir | grep -v ^Filesystem | awk '{print $NF}'`
}
	
	
if [ $# -ne 1 ]
then
	usage
fi

for brick in $BRICK_IP_ADDRS
do
	mount_point=`get_mount $brick $SERVER_EXPORT_DIR`
	if [ "$1" == "on" ]
	then
		ssh -l root $brick mount -o remount,acl $mount_point
	elif [ "$1" == "off" ]
	then
		ssh -l root $brick  mount -o remount,noacl $mount_point
	else
		usage
	fi
done