#!/bin/bash
read -p "请输入挂载点" dir echo "挂载光盘" [ -d $dir ] || mkdir $dir mount | grep -q "/dev/sr0" && umount /dev/sr0 mount /dev/sr0 $dir &> /dev/dull
echo "配置yum仓库" cd /etc/yum.r* [ -d a ] || mkdir a
cat << END > local.repo [wangrui] name=wangrui baseurl=file://$dir enabled=1 gpgcheck=0 END
echo "清缓存" yum clean all &> /dev/dull && yum makecache &> /dev/dull && echo "yum创建成功"