更新 setup.sh

This commit is contained in:
2025-10-25 19:20:09 -07:00
parent f1d1ce5013
commit 71426278ad

View File

@@ -21,8 +21,11 @@ for choice in $choices; do
sysctl -p
;;
2)
read -p "输入Swap内存大小(MB): " swap_size
echo "执行设置Swap内存大小的脚本..."
echo "输入Swap内存大小(MB) [默认: 2G]: "
read -t 5 -p "> " swap_size
if [ $? -ne 0 ] || [ -z "$swap_size" ]; then
echo -e "\n使用默认值: ${swap_size}MB"
fi
dd if=/dev/zero of=/swapfile bs=1M count=$swap_size
mkswap /swapfile
swapon /swapfile
@@ -34,11 +37,10 @@ for choice in $choices; do
echo -e 'if [ -f ~/.alias.txt ]; then\n . ~/.alias.txt\nfi' >>~/.bashrc
;;
4)
echo "即将安装htop cbm tree ufw curl wget lsof micro git git-lfs 7z zellij"
echo "可选: build-essential ffmpeg"
read -p "额外安装(包名): " app
echo "即将安装htop cbm tree ufw curl wget lsof micro git git-lfs 7z zellij build-essential ffmpeg"
read -t 5 -p "额外安装(包名): " app
apt update -y
apt install -y htop cbm tree ufw curl wget lsof micro git git-lfs $app
apt install -y htop cbm tree ufw curl wget lsof micro git git-lfs build-essential ffmpeg $app
wget https://git.nvme.cc/adminroot/auto-update/raw/branch/main/app/zellij -O /usr/local/bin/zellij
wget https://git.nvme.cc/adminroot/auto-update/raw/branch/main/app/7zz -O /usr/local/bin/7z
chmod +x /usr/local/bin/7z /usr/local/bin/zellij
@@ -104,7 +106,7 @@ ufw reload'
sed -i '$a import /etc/caddy/sites/*.txt' /etc/caddy/Caddyfile
;;
8)
read -p "Conda安装路径 (默认: ~/.miniconda3): " CONDA_PATH
read -t 5 -p "Conda安装路径 (默认: ~/.miniconda3): " CONDA_PATH
CONDA_PATH=${CONDA_PATH:-"$HOME/.miniconda3"}
PROFILE="$HOME/.bashrc"
ARCH=$(uname -m)