File: gfarm2fs_fix_acl.sh

package info (click to toggle)
gfarm2fs 1.2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,708 kB
  • sloc: sh: 13,372; ansic: 3,985; makefile: 205; perl: 57
file content (39 lines) | stat: -rwxr-xr-x 571 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

#
# $Id: gfarm2fs_fix_acl.sh 5239 2011-03-29 12:01:01Z takuya-i $
#

gfgroup_exist() {
  group=$1
  user=$2

  gfgroup -l $group | egrep " ${user} | ${user}\$" > /dev/null
  return $?
}

WHOAMI=`gfwhoami`
if gfgroup_exist gfarmroot $WHOAMI ; then
  :
else
  echo You\(${WHOAMI}\) do not belong to gfarmroot. 1>&2
  exit 1
fi

TMP=`mktemp -d`
if [ $? -ne 0 ]; then
  echo cannot create a temporary directory. 1>&2
  exit 1
fi

gfarm2fs $TMP -o fix_acl
wait

find $TMP -exec gfarm2fs_fix_acl -cr {} \;
retv=$?

sleep 10
fusermount -u $TMP
rmdir $TMP

exit $retv