优化yum源(Optimize Yum source)

#!/bin/bash

#备份原有的yum文件
cp /etc/yum.repos.d/CentOS-Base.repo{,.bak}
#更新yum文件为阿里云,和epel
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
if [ $? -eq 0 ];then
        echo "yum源更新成功"
        yum install vim bash-completion wget -y
        if [ $? -eq 0 ];then
                echo "vim等工具安装成功"
                wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
                if [ $? -eq 0 ];then
                        echo "eple安装成功"
                else
                        echo "eple 安装失败"
                fi
        else 
                echo "工具安装失败"
        fi
else
        echo "更新yum源失败"
fi

————————
#!/bin/bash

#备份原有的yum文件
cp /etc/yum.repos.d/CentOS-Base.repo{,.bak}
#更新yum文件为阿里云,和epel
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
if [ $? -eq 0 ];then
        echo "yum源更新成功"
        yum install vim bash-completion wget -y
        if [ $? -eq 0 ];then
                echo "vim等工具安装成功"
                wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
                if [ $? -eq 0 ];then
                        echo "eple安装成功"
                else
                        echo "eple 安装失败"
                fi
        else 
                echo "工具安装失败"
        fi
else
        echo "更新yum源失败"
fi