本地yum仓库搭建脚本
#!/bin/bash
#创建yum仓库的脚本
dou=/media/cdrom
[ -d $dou ] || mkdir $dou
umount /dev/cdrom &> /dev/null
mount /dev/cdrom/ $dou &> /dev/null
cd /etc/yum.repos.d/
[ -d a ] || mkdir a
[ -e *.repo ] || mv C* a
[ -e *.repo ] || echo "
[cdrom]
name=cdrom
baseurl=file://$dou
enabled=1
gpgcheck=0" >local.repo
yum clean all &> /dev/null
yum makecache &> /dev/null