标签:ack else div .com centos5 ror code class cache
1 #!/bin/bash 2 #Author:nulige 3 #Date: 2015-3-8 4 #实现功能:自动判断你的系统是Centos版本,适用于5.x或6.x 5 6 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.$(date +%F)_backup 7 cd /etc/yum.repos.d/ 8 Ver=$(cat /etc/redhat-release |awk -F "." ‘{print $1}‘) 9 if [ "${Ver}" == "CentOS release 6" ] 10 then 11 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 12 else 13 wget http://mirrors.163.com/.help/CentOS5-Base-163.repo 14 fi 15 16 yum clean headers 17 yum makecache 18 sleep 2 19 echo -e "\033[32mPlease select Menu follow:\033[1m]" 20 21 echo "##########################################" 22 echo " The installation is complete " 23 echo "##########################################"
配置163Yum源自动判断你的系统是Centos版本(适用于5.x或6.x)
标签:ack else div .com centos5 ror code class cache
原文地址:http://www.cnblogs.com/nulige/p/6087626.html