VERSION1=`sed -n 1p /etc/issue|awk BEGIN{OFS=""} {print $1,$2,$7}`
VERSION2=`sed -n 1p /etc/issue|awk BEGIN{OFS=""} {print $1,$2,$7}|awk -F. {print $1}`
elif [ -e "/etc/SuSE-release" ] ; then
VERSION1=`sed /^$/d /etc/issue|awk BEGIN{OFS=""} {print $3,$7,$8}`
VERSION2=`sed /^$/d /etc/issue|awk BEGIN{OFS=""} {print $3,$7}`
elif [ -e "/etc/centos-release" ] ; then
VERSION1=`sed -n 1p /etc/issue|awk BEGIN{OFS=""} {print $1,$2,$7}`
VERSION2=`sed -n 1p /etc/issue|awk BEGIN{OFS=""} {print $1,$2,$7}|awk -F. {print $1}`
fi
#VALUE=`/usr/bin/getconf LONG_BIT`
OSDIGIT=`/bin/uname -m`
YUM=`which yum`
P_YUM="/etc/yum.repos.d/"
#-----------------------------------------------------------------------------------------------
# Download yum client configure file
if [ -d $P_YUM ] ; then
mv $P_YUM /etc/yum.repos.d.bak
mkdir -p $P_YUM
fi
/usr/bin/wget -N -q -P $P_YUM $1/rhelrepo/$VERSION2.repo \
|| errorExit Failed to download the yum client files,Please manually configure!
/bin/sed -i s/RedHat/$VERSION1\_$OSDIGIT/g $P_YUM$VERSION2.repo \
|| errorExit Replace the files is not successful,Please manually configure!
if [ -f $P_YUM$VERSION2.repo ]; then
displayheader "Successfully configured yum client, please continue"
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/bofangqi/article-62078-4.html
不喜欢舒淇
没有女人好睡
改变了历史哦