|
|
|
@ -16,8 +16,8 @@ bar=" |
|
|
|
|
=================================" |
|
|
|
|
echo -e $bar |
|
|
|
|
read -p "请选择配置项: " num |
|
|
|
|
case $num in |
|
|
|
|
1) |
|
|
|
|
|
|
|
|
|
if [[ $num -eq 1 ]];then |
|
|
|
|
cd /etc/yum.repos.d/ && \ |
|
|
|
|
dirname=$(mktemp -d repo-XXXXX) |
|
|
|
|
mv *.repo $dirname 2>/dev/null |
|
|
|
@ -32,39 +32,35 @@ case $num in |
|
|
|
|
yum clean all && \ |
|
|
|
|
yum makecache && \ |
|
|
|
|
echo "缓存创建完成" |
|
|
|
|
;; |
|
|
|
|
2) |
|
|
|
|
elif [[ $num -eq 2 ]];then |
|
|
|
|
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) |
|
|
|
|
elif [[ $num -eq 3 ]];then |
|
|
|
|
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) |
|
|
|
|
elif [[ $num -eq 4 ]];then |
|
|
|
|
echo "暂不支持" |
|
|
|
|
;; |
|
|
|
|
5) |
|
|
|
|
elif [[ $num -eq 5 ]];then |
|
|
|
|
echo "暂不支持" |
|
|
|
|
;; |
|
|
|
|
6) |
|
|
|
|
elif [[ $num -eq 6 ]];then |
|
|
|
|
cd /etc/yum.repos.d/ && \ |
|
|
|
|
dirname=$(mktemp -d repo-XXXXX) |
|
|
|
|
mv *.repo $dirname 2>/dev/null |
|
|
|
|
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo |
|
|
|
|
curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo |
|
|
|
|
echo "阿里云源配置完成" |
|
|
|
|
;; |
|
|
|
|
q) |
|
|
|
|
echo "开始创建缓存" |
|
|
|
|
yum clean all && \ |
|
|
|
|
yum makecache && \ |
|
|
|
|
echo "缓存创建完成" |
|
|
|
|
elif [[ $num == "q" ]];then |
|
|
|
|
exit 0 |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
else |
|
|
|
|
echo "输入有误,请重新输入" |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
fi |
|
|
|
|