Skip to content

Commit 8cf9d9c

Browse files
committed
修改
1 parent 6bb5737 commit 8cf9d9c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Termux/install-NC

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ log() {
4242
;;
4343
esac
4444
}
45-
45+
46+
# 检查命令是否存在
47+
command_exists() {
48+
command -v "$1" >/dev/null 2>&1
49+
}
50+
4651
# 更新源到清华镜像
4752
if ! grep -q "mirrors.tuna.tsinghua.edu.cn" "$PREFIX/etc/apt/sources.list"; then
4853
log "INFO" "更新软件源到清华镜像..."
@@ -52,12 +57,12 @@ if ! grep -q "mirrors.tuna.tsinghua.edu.cn" "$PREFIX/etc/apt/sources.list"; then
5257
fi
5358

5459
for cmd in screen proot-distro; do
55-
command -v "$cmd" >/dev/null 2>&1 || pkg install -y "$cmd"
60+
command_exists "$cmd" || pkg install -y "$cmd"
5661
done
5762

5863
if [ ! -d "$PREFIX/var/lib/proot-distro/installed-rootfs/nc/" ]; then
5964
log "INFO" "安装debian容器..."
60-
export PD_OVERRIDE_TARBALL_URL="https://raw.githubusercontent.com/Dong-Jing-Yu/Dong-Jing-Yu.github.io/refs/heads/main/Termux/proot-distro/debian-bookworm-aarch64-pd-v4.17.3.tar.xz"
65+
export PD_OVERRIDE_TARBALL_URL="https://gh-proxy.com/https://raw.githubusercontent.com/Dong-Jing-Yu/Dong-Jing-Yu.github.io/refs/heads/main/Termux/proot-distro/debian-bookworm-aarch64-pd-v4.17.3.tar.xz"
6166
proot-distro install debian --override-alias nc
6267
log "INFO" "安装完成!"
6368
fi

0 commit comments

Comments
 (0)