From ba30ef9d2eb6b6521634770d549836153046198e Mon Sep 17 00:00:00 2001 From: admin <84259781@qq.com> Date: Wed, 14 Oct 2026 19:19:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20gcc9.3.0.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcc9.3.0.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 gcc9.3.0.sh diff --git a/gcc9.3.0.sh b/gcc9.3.0.sh new file mode 100644 index 0000000..31fd9bd --- /dev/null +++ b/gcc9.3.0.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ $EUID != 0 ]; then + echo "评测机脚本需要使用 root 权限,请先使用 sudo su 切换到 root 用户后再运行此脚本。" + exit $? +fi + +# 切换到 root 目录(cd 不需要 sudo,因为脚本可能已用 root 执行) +cd /root || { echo "无法进入 /root 目录"; exit 1; } + +# 下载缓存文件(如果需要验证文件,可添加 -c 断点续传或 --check-certificate=off 忽略证书) +echo "正在下载 gcc9.3.0 缓存文件..." +wget http://10.16.80.222:3000/Weishen/Hydro-Setup/raw/branch/main/gcc9.3.0-cache.nix -O gcc9.3.0-cache.nix || { + echo "下载失败,请检查网络或文件地址"; + exit 1; +} + +# 导入缓存到 nix-store(需要 root 权限) +echo "正在导入缓存文件..." +nix-store --import < gcc9.3.0-cache.nix || { + echo "导入缓存失败"; + exit 1; +} + +rm gcc9.3.0-cache.nix + +echo "gcc9.3.0 缓存导入成功!"