#!/bin/bash
Abc=$(yum repolist | awk '/repolist/{print$2}' | sed 's/,//')
echo -e "\033[32m YUM可用:$Abc \033[0m"
if
[ $Abc = 0 ]
then
echo -e "\033[32m 正在换YUM \033[0m"
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
fi