2024-10-10
This commit is contained in:
8
install/autocpu.sh
Executable file
8
install/autocpu.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
CPU=`grep "cpu cores" /proc/cpuinfo |head -1|awk '{print $4}'`
|
||||
COMPENSATION=`grep 'mips' /proc/cpuinfo|head -1|awk -F: '{printf("%.2f",$2/5000)}'`
|
||||
cd /home/judge
|
||||
sed -i "s/OJ_RUNNING=1/OJ_RUNNING=$CPU/g" etc/judge.conf
|
||||
sed -i "s/OJ_CPU_COMPENSATION=1.0/OJ_CPU_COMPENSATION=$COMPENSATION/g" etc/judge.conf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user