Files
hustoj/install/podman.sh
2024-10-10 12:56:56 +08:00

21 lines
892 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
cd /home/judge/src/install || exit 1
while ! apt-get install -y podman containerd
do
echo "Network fail, retry... you might want to make sure podman is available in your apt source"
done
IP=`curl http://hustoj.com/ip.php`
while ! podman build -t hustoj .
do
echo "Visit http://$IP to regist your admin account of HUSTOJ instance."
echo "Left this console working on retry ... podman activation."
echo "Network fail, retry... you might want to make sure podman image source is available"
done
sed -i "s/OJ_USE_DOCKER=0/OJ_USE_DOCKER=1/g" /home/judge/etc/judge.conf
sed -i "s/OJ_PYTHON_FREE=0/OJ_PYTHON_FREE=1/g" /home/judge/etc/judge.conf
sed -i "s/OJ_INTERNAL_CLIENT=1/OJ_INTERNAL_CLIENT=0/g" /home/judge/etc/judge.conf
sed -i "s|OJ_DOCKER_PATH=/usr/bin/docker|OJ_DOCKER_PATH=/usr/bin/podman|g" /home/judge/etc/judge.conf
pkill -9 judged
/usr/bin/judged