-
Notifications
You must be signed in to change notification settings - Fork 3
/
.createpriv.sh
36 lines (33 loc) · 965 Bytes
/
.createpriv.sh
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
#!/bin/bash
cd /mnt/BAILnas/Pub
declare -a synclistshare=(
"Anthony-Anthony-Anthony"
"Diana-Diana-Diana"
"Fupeng-Fupeng-Fupeng"
"Guest-0guest-BAILguest"
"Jayson-Jayson-jingjiang"
"Jenny-Jenny-Jenny"
"Kanheng-Kanheng-Kanheng"
"Kevin-Kevin-Kevin"
"Mitch-Mitch-Mitch"
"Nhan-Nhan-nhanle"
"Peijun-Peijun-Peijun"
"Qinqin-Qinqin-Qinqin"
"Ricky-Ricky-Ricky"
"Shaozhen-Shaozhen-szsong"
"Shuyuan-Shuyuan-Shuyuan"
"Wei-Wei-Wei"
"Yining-Yining-Yining"
"Yuxuan-Yuxuan-yuxuan"
"Zhongdi-Zhongdi-Zhongdi"
)
printf "\n=====Synchronizing shared folders=====\n\n\n" | tee -a $pathLOG
for i in "${synclistshare[@]}"
do
pathSOR=$(echo $i | cut -f1 -d-)
pathTAR=$(echo $i | cut -f2 -d-)
userTAR=$(echo $i | cut -f3 -d-)
printf "\n=====Synchronizing $pathSOR to $pathTAR=====\n" | tee -a $pathLOG
mkdir "$pathTAR.p/0priv"
chown -R "$userTAR:wheel" "$pathTAR.p/0priv" | tee -a $pathLOG
done