加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
start.sh 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
Arc图一多 提交于 2023-06-02 17:57 . 测试
#!/usr/bin/env bash
unset LD_PRELOAD
set -e
# Set the default command
command=("proot"
"--link2symlink"
"-0"
"-r ubuntu-fs"
"-b /dev"
"-b /proc"
"-b ubuntu-fs/root:/dev/shm"
"-w /root"
"/usr/bin/env"
"-i"
"HOME=/root"
"PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games"
"TERM=$TERM"
"LANG=C.UTF-8"
"/bin/bash"
"--login")
# Check if the binds directory exists, and if so, add the binds to the command
if [ -d "binds" ]; then
for f in binds/* ;do
. "$f"
done
fi
# Check if the user wants to mount the home directory of Termux
if [ -n "$TERMUX_HOME_MOUNT" ]; then
command+=("-b" "/data/data/com.termux/files/home:/root")
fi
# Check if the user wants to mount the sdcard directory directly to /
if [ -n "$TERMUX_SDCARD_MOUNT" ]; then
command+=("-b" "/sdcard")
fi
# Check if the user has provided any arguments, and if so, add them to the command
if [ $# -gt 0 ]; then
command+=("-c" "$*")
fi
# Run the command
if [ -n "$TERMUX_FISH" ]; then
exec fish "${command[@]}"
else
exec "${command[@]}"
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化