#!/bin/bash getAptPackage(){ printf "\n\n==> Getting environment packages\n" export DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y vim ntp zip unzip curl wget build-essential fp-compiler python python3 python3-requests openjdk-8-jdk openjdk-11-jdk } setJudgeConf(){ printf "\n\n==> Setting judger files\n" #Add judger user adduser judger --gecos "" --disabled-password #Set uoj_data path mkdir /var/uoj_data_copy && chown judger /var/uoj_data_copy #Compile uoj_judger and set runtime chown -R judger:judger /opt/uoj/judger su judger <uoj_judger/include/uoj_work_path.h < Doing initial config and start service\n" #Check envs if [ -z "$UOJ_PROTOCOL" -o -z "$UOJ_HOST" -o -z "$JUDGER_NAME" -o -z "$JUDGER_PASSWORD" -o -z "$SOCKET_PORT" -o -z "$SOCKET_PASSWORD" ]; then echo "!! Environment variables not set! Please edit config file by yourself!" else #Set judge_client config file cat >../../judger/.conf.json <0?1:0 )) done