This commit is contained in:
Konano 2024-10-17 09:02:09 +08:00
parent 883b459202
commit ad80b91f6b
2 changed files with 25 additions and 23 deletions

View File

@ -177,17 +177,17 @@ configure_zsh() {
~/.miniconda3/bin/mamba init zsh
fi
cp $scriptdir/files/zsh/.zsh_user ~/.zsh_user
cp $scriptdir/files/zsh/00-init.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/10-theme.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/20-function.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/50-env.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/51-alias.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/90-other.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/.zsh_user ~/.zsh_user
cp $scriptdir/files/zsh/00-init.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/10-theme.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/20-function.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/50-env.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/51-alias.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/90-other.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/ys-simple.zsh-theme ~/.oh-my-zsh/custom/themes/
[ $abroad -eq 1 ] && return
cp $scriptdir/files/zsh/80-proxy.zsh ~/.oh-my-zsh/custom/
cp $scriptdir/files/zsh/80-proxy.zsh ~/.oh-my-zsh/custom/
fi
}
@ -227,11 +227,11 @@ configure_docker() {
fi
# 添加软件源的 GPG 密钥,并向 sources.list 中添加 Docker 软件源
if [ $abroad -eq 1 ]; then
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/docker-archive-keyring.gpg >/dev/null
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
else
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/docker-archive-keyring.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/docker-archive-keyring.gpg >/dev/null
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
fi
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
@ -263,26 +263,28 @@ configure_docker() {
}
configure_yarn() {
echo "Incomplete"; return
echo "Incomplete"
return
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarn.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list > /dev/null
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarn.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list >/dev/null
}
configure_mongodb() {
echo "Incomplete"; return
echo "Incomplete"
return
version=7.0
curl -fsSL https://pgp.mongodb.com/server-$version.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-server-$version.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-server-$version.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/$version multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-$version.list > /dev/null
curl -fsSL https://pgp.mongodb.com/server-$version.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-server-$version.gpg >/dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mongodb-server-$version.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/$version multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-$version.list >/dev/null
}
configure_nginx() {
[ $offline -eq 1 ] && return
if [ ! -f /etc/apt/sources.list.d/nginx.list ]; then
curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/nginx.gpg] https://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx" | sudo tee /etc/apt/sources.list.d/nginx.list > /dev/null
echo "deb-src [signed-by=/usr/share/keyrings/nginx.gpg] https://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list > /dev/null
curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/nginx.gpg] https://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx" | sudo tee /etc/apt/sources.list.d/nginx.list >/dev/null
echo "deb-src [signed-by=/usr/share/keyrings/nginx.gpg] https://nginx.org/packages/ubuntu/ $(lsb_release -cs) nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list >/dev/null
fi
if confirm_action "要安装 nginx 吗?" "Y"; then
sudo apt update
@ -439,4 +441,4 @@ configure_hostname
configure_timedate
configure_bootinfo
configure_oomkiller
# configure_swap
# configure_swap

View File

@ -80,7 +80,7 @@ configure_nvm() {
nvm alias default lts/iron
nvm install-latest-npm
if [ $abroad -ne 1 ]; then
echo "registry=https://registry.npmmirror.com" > ~/.npmrc
echo "registry=https://registry.npmmirror.com" >~/.npmrc
fi
fi
}