-
Notifications
You must be signed in to change notification settings - Fork 1
/
server-setup.sh
executable file
·33 lines (31 loc) · 1.14 KB
/
server-setup.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
#!/bin/bash
RED="\033[1;31m"
RESET="\033[m"
# Generate valid server format
echo "================================================================================
Generating problems...
================================================================================"
python generate_problem_format.py
# Copy problems to server
echo "================================================================================
Copying problems to server...
================================================================================"
copy() {
if [[ -d ../stuyCTF-Platform/problems/ ]]; then
printf "${RED}../stuyCTF-Platform/problems/ already exists!\n${RESET}"
echo "Overwrite it? (y/n)"
read ans
if [[ $ans == "y" ]]; then
# Back up README.md
mv ../stuyCTF-Platform/problems/README.md /tmp/server-setup-README.md
rm -rf ../stuyCTF-Platform/problems
else
return
fi
fi
mkdir -p ../stuyCTF-Platform/problems
cp -r STUYCTF_SERVER/* ../stuyCTF-Platform/problems
# Restore README.md
mv /tmp/server-setup-README.md ../stuyCTF-Platform/problems/README.md
}
copy