You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shell-project/os/get-repo.sh

60 lines
1.5 KiB

#!/usr/bin/bash
# 配置nexus 客户端
bar="
==================================\n
Nexus 客户端配置 \n
1. 配置yum源 \n
2. 配置docker镜像仓库 \n
3. 配置pip源 \n
4. 【未启用】配置npm源 \n
5. 【未启用】配置maven源 \n
q. 退出 \n
================================="
echo $bar
read -p "请选择配置项: " num
case $num in
1)
cd /etc/yum.repos.d/ && \
dirname=$(mktemp -d repo-XXXXX)
mv * $dirname && \
cd $dirname && \
for i in "nexus-Centos-Base.repo nexus-epel.repo nexus-mysql.repo nexus-docker-ce.repo"
do
curl -o $i https://gitea.beyourself.org.cn/newrain001/download/raw/branch/master/repo/$i
echo "yum 源 $i 配置完成"
done
echo "开始创建缓存"
yum clean all && \
yum makecache && \
echo "缓存创建完成"
;;
2)
if [! -d "/etc/docker/" ]; then
mkdir /etc/docker
fi
curl -o /etc/docker/daemon.json https://gitea.beyourself.org.cn/newrain001/download/raw/branch/master/repo/nexus-daemon.json
echo "daemon.json 配置完成"
;;
3)
if [ ! -d $HOME/.pip ]; then
mkdir $HOME/.pip
fi
curl -o $HOME/.pip/pip.conf https://gitea.beyourself.org.cn/newrain001/download/raw/branch/master/repo/pip.conf
echo "pip.conf 配置完成"
;;
4)
echo "暂不支持"
;;
5)
echo "暂不支持"
;;
q)
exit 0
;;
*)
echo "输入有误,请重新输入"
;;
esac