-
Notifications
You must be signed in to change notification settings - Fork 1
/
upgrade.sh
executable file
·49 lines (43 loc) · 1.19 KB
/
upgrade.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
#!/bin/bash
CPU_CORE=`nproc`
./shell/build_dependency.sh
git fetch --all && \
git reset --hard origin/master && \
./shell/build_source_code.sh && \
chgrp -R judge /usr/lib/cupjudge && \
chown -R judge /usr/lib/cupjudge
if [ ! -d /home/judge/etc ]; then
mkdir -p /home/judge/etc
cp -r etc/* /home/judge/etc/
./shell/build_config.sh
else
if [ ! -f /home/judge/etc/language.json ]; then
cp etc/language.json /hone/judge/etc/language.json
fi
if [ ! -f /home/judge/etc/java0.policy ]; then
cp etc/java0.policy /home/judge/etc/java0.policy
fi
if [ ! -f /home/judge/etc/judge.conf ]; then
cp etc/judge.conf /home/judge/etc/judge.conf
fi
if [ ! -f /home/judge/etc/compile.json ]; then
cp etc/compile.json /home/judge/etc/compile.json
fi
if [ ! -f /home/judge/etc/config.json ]; then
./shell/build_config.sh
fi
fi
if [ ! -f /usr/bin/sim.sh ]; then
cd sim && \
make fresh && \
make exes && \
chmod +x sim* && \
cp sim_c.exe /usr/bin/sim_c && \
cp sim_c++.exe /usr/bin/sim_cc && \
cp sim_java.exe /usr/bin/sim_java && \
cp sim_pasc.exe /usr/bin/sim_pas && \
cp sim_text.exe /usr/bin/sim_text && \
cp sim_lisp.exe /usr/bin/sim_scm && \
cp sim.sh /usr/bin/ && \
chmod +x /usr/bin/sim.sh
fi