-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-test-data.sh
More file actions
executable file
·56 lines (46 loc) · 1.23 KB
/
build-test-data.sh
File metadata and controls
executable file
·56 lines (46 loc) · 1.23 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
TD=/opt/testdata
rm -rf /opt/testdata
# oneuser 84
# twouser 85
# threeuser 86
# oneusernew 87
# twousernew 88
# threeusernew 89
# --uidpair 84:87 --uidpair 85:88 --uidpair 86:89
useradd one
useradd oneuser
useradd twouser
useradd threeuser
useradd oneusernew
useradd twousernew
useradd threeusernew
mkdir -p $TD
mkdir -p $TD/shared/
chown oneuser $TD/shared/
mkdir -p $TD/one
echo "one data" | tee -a $TD/one/onefile
echo "one shared data" | tee -a $TD/shared/one
chown -R oneuser $TD/one/
chmod -R u=rwx,g=rwx $TD/one/
chown oneuser $TD/shared/one
setfacl -m u:oneuser:r $TD/shared/
setfacl -d -m u:oneuser:r $TD/shared/
mkdir -p $TD/two
echo "two data" | tee -a $TD/two/twofile
echo "two shared data" | tee -a $TD/shared/two
chown -R twouser $TD/two/
chmod -R u=rwx,g=rwx $TD/two/
chown twouser $TD/shared/two
setfacl -m u:twouser:r $TD/shared/
setfacl -d -m u:twouser:r $TD/shared/
mkdir -p $TD/three
echo "three data" | tee -a $TD/three/threefile
echo "three shared data" | tee -a $TD/shared/three
chown -R threeuser $TD/three/
chmod -R u=rwx,g=rwx $TD/three/
chown threeuser $TD/shared/three
setfacl -m u:threeuser:r $TD/shared/
setfacl -d -m u:threeuser:r $TD/shared/
rm -f $TD/one/shared-one
ln -s $TD/shared/one $TD/one/shared-one