-
Notifications
You must be signed in to change notification settings - Fork 0
/
confLocalsystem.sh
executable file
·86 lines (52 loc) · 1.47 KB
/
confLocalsystem.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
#chmod +x run.sh
rm myfile.txt
repliport=30005
dirport=20005
managerport=40002
END=$1
for ((i=1;i<=40;i++)); do
STRDir="Client"
STRDirNo="Client$i"
STRDirNo=$i;
mkdir -p System/"$STRDir/$STRDirNo"
cp -r "Client/"/* "System/$STRDir/$STRDirNo"
done
echo "#DIRECTORIES" >> myfile.txt
echo "$1" >> myfile.txt
for ((i=1;i<=END;i++)); do
STRDir="Directory_"
STRDir+=$i;
dirport=$(($dirport + $i))
echo "$2 $dirport " >> myfile.txt
mkdir -p System/"$STRDir"
cp -r "Directory/"/* "System/$STRDir"
gnome-terminal -x sh -c "cd System/$STRDir ; ./dir -p $dirport; cat"
done
echo "#REPLICAS" >> myfile.txt
echo "$1" >> myfile.txt
for ((i=1;i<=END;i++)); do
STRRep="Replica_"
STRRep+=$i;
repliport=$(($repliport + $i))
echo "$2 $repliport " >> myfile.txt
mkdir -p System/"$STRDir"
mkdir -p System/"$STRRep"
cp -r "Replica/"/* System/$STRRep
gnome-terminal -x sh -c "cd System/$STRRep ; ./repli -p $repliport; cat"
done
echo "#FILEMANAGERS" >> myfile.txt
echo "$1" >> myfile.txt
for ((i=1;i<=END;i++)); do
STRManager="FileManager_"
STRManager+=$i;
managerport=$(($managerport + $i))
echo "$2 $managerport " >> myfile.txt
mkdir -p System/"$STRManager"
cp -r "FileManager/"/* System/$STRManager
gnome-terminal -x sh -c "cd System/$STRManager ; ./fil -p $managerport; cat"
done
echo "#PERMISSION" >> myfile.txt
echo "L0" >> myfile.txt
echo 'Script run'
exit