File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ log() {
42
42
;;
43
43
esac
44
44
}
45
-
45
+
46
+ # 检查命令是否存在
47
+ command_exists () {
48
+ command -v " $1 " > /dev/null 2>&1
49
+ }
50
+
46
51
# 更新源到清华镜像
47
52
if ! grep -q " mirrors.tuna.tsinghua.edu.cn" " $PREFIX /etc/apt/sources.list" ; then
48
53
log " INFO" " 更新软件源到清华镜像..."
@@ -52,12 +57,12 @@ if ! grep -q "mirrors.tuna.tsinghua.edu.cn" "$PREFIX/etc/apt/sources.list"; then
52
57
fi
53
58
54
59
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 "
56
61
done
57
62
58
63
if [ ! -d " $PREFIX /var/lib/proot-distro/installed-rootfs/nc/" ]; then
59
64
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"
61
66
proot-distro install debian --override-alias nc
62
67
log " INFO" " 安装完成!"
63
68
fi
You can’t perform that action at this time.
0 commit comments