S2OJ/install/judge_client/install
MascoSkray c5ef73dc76
style: move install files to a renamed folder
The installation files are dirty when they are outside of the folder. It now looks not so mess.
And there is no need to place empty jdk files. 果断删除之。
2017-09-07 13:16:13 +08:00

33 lines
1.1 KiB
Bash

#!/bin/sh
sudo adduser judger --gecos "" --disabled-password
mv /root/jdk-7u76-linux-x64.tar.gz /root/jdk-8u31-linux-x64.tar.gz /root/conf.json /home/judger
chown judger /home/judger/jdk-7u76-linux-x64.tar.gz /home/judger/jdk-8u31-linux-x64.tar.gz /home/judger/conf.json
chgrp judger /home/judger/jdk-7u76-linux-x64.tar.gz /home/judger/jdk-8u31-linux-x64.tar.gz /home/judger/conf.json
mkdir /var/uoj_data_copy
chown judger /var/uoj_data_copy
su judger <<EOD
cd ~
mkdir judge_client_svn
cd judge_client_svn
svn co svn://__uoj_host__/judge_client __svn_cert__
cd ~
ln -s judge_client_svn/judge_client/1 judge_client
cd judge_client
echo '#define UOJ_WORK_PATH "/home/judger/judge_client/uoj_judger"' >uoj_judger/include/uoj_work_path.h
make
ln -s /var/uoj_data_copy ~/judge_client/uoj_judger/data
mkdir ~/judge_client/uoj_judger/run/runtime
mv ~/jdk-7u76-linux-x64.tar.gz ~/jdk-8u31-linux-x64.tar.gz ~/judge_client/uoj_judger/run/runtime
cd ~/judge_client/uoj_judger/run/runtime
tar -xzf jdk-7u76-linux-x64.tar.gz
tar -xzf jdk-8u31-linux-x64.tar.gz
mv ~/conf.json ~/judge_client/.conf.json
chmod 600 ~/judge_client/.conf.json
EOD