forked from cheekujodhpur/ipho2015
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize.sh
More file actions
executable file
·128 lines (104 loc) · 2.26 KB
/
initialize.sh
File metadata and controls
executable file
·128 lines (104 loc) · 2.26 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
#create the directories
rm -r ./uploads
rm -r ./downloads
rm -r ./common
rm mk/*1.html
rm mk/*2.html
mkdir ./uploads
mkdir ./downloads
mkdir ./common
mkdir ./common/T1
mkdir ./common/T2
mkdir ./common/T3
mkdir ./common/E1
mkdir ./common/E2
mkdir ./common/E1a
mkdir ./common/E2a
mkdir ./common/C1
mkdir ./common/C2
#copy the contents of server_editable.js to server.js
chmod 777 server.js
cp server_editable.js server.js
#drop the old databases
inp='db.users.drop()'
echo $inp
mongo test --eval $inp
inp='db.subparts.drop()'
echo $inp
mongo test --eval $inp
inp='db.uploads.drop()'
echo $inp
mongo test --eval $inp
inp='db.votec.drop()'
echo $inp
mongo test --eval $inp
inp='db.voteq.drop()'
echo $inp
mongo test --eval $inp
inp='db.messages.drop()'
echo $inp
mongo test --eval $inp
inp='db.messages_archive.drop()'
echo $inp
mongo test --eval $inp
inp='db.fbs.drop()'
echo $inp
mongo test --eval $inp
inp='db.flags.drop()'
echo $inp
mongo test --eval $inp
inp='db.marks_T1.drop()'
echo $inp
mongo test --eval $inp
inp='db.marks_T2.drop()'
echo $inp
mongo test --eval $inp
inp='db.marks_T3.drop()'
echo $inp
mongo test --eval $inp
inp='db.marks_E1.drop()'
echo $inp
mongo test --eval $inp
inp='db.marks_E2.drop()'
echo $inp
mongo test --eval $inp
inp='db.ourMarks_T1.drop()'
echo $inp
mongo test --eval $inp
inp='db.ourMarks_T2.drop()'
echo $inp
mongo test --eval $inp
inp='db.ourMarks_T3.drop()'
echo $inp
mongo test --eval $inp
inp='db.ourMarks_E1.drop()'
echo $inp
mongo test --eval $inp
inp='db.ourMarks_E2.drop()'
echo $inp
mongo test --eval $inp
#all the ip
while read -r LINE;
do
if [[ $LINE != '#'* ]];
then
./add_ip.sh $LINE;
fi
done < country_code_ip.txt
./add_subparts.sh <data/t1_subparts.txt
./add_subparts.sh <data/t2_subparts.txt
./add_subparts.sh <data/t3_subparts.txt
./add_subparts.sh <data/e1_subparts.txt
./add_subparts.sh <data/e2_subparts.txt
echo 'app.use("/downloads/",express.static(__dirname + "/downloads/"));console.log("File download enabled for /downloads/");' >> server.js
#make server.js read and executable
chmod 555 server.js
#Flag validation
echo "----FLAG VALIDATION----"
./validate_flags.sh
echo "-----------------------"
#data validation
echo "----DATA VALIDATION----"
./validate_data.sh
echo "-----------------------"