[i=s] 本帖最后由 li-0578 于 2009-4-13 11:51 编辑 [/i]
#!/bin/bash
#this program will create yum and will creater "/tp"director
echo -e "please tell me where you want to save rpm file"
read RPMSAVE if [ -d "$RPMSAVE" ]; then echo "ok will go on"
fi
while [ ! -d "$RPMSAVE" ]; do
echo "no have this director please change"
read RPMSAVE
done
# creater DVD mount point
mkdir /mnt/cd
# creater xml file save director
mkdir /tp
# mount DVD
mount /dev/cdrom /mnt/cd
# creater sub director
mkdir $RPMSAVE/server
mkdir $RPMSAVE/vt
# copy rpm file
cp -r /mnt/cd/Server/* $RPMSAVE/server
cp -r /mnt/cd/VT* $RPMSAVE/vt
# creater xml file
cd $RPMSAVE
for name in server vt
cp $name/repodata/comps-rhel5-*.xml /tp
done
cd $RPMSAVE/server
rm -rf repodata
createrepo -g /tp/comps-rhel5-server-core.xml .
cd $RPMSAVE/vt
rm -rf repodata
createrepo -g /tp/comps-rhel5-vt.xml .
以上是脚本文件
YUM库的配置文件就自己写吧!
这是第一个版本,有些功能还不是很好.大家可以提出自己的建议或是自己修改使用
cwqing1973 于 2009-04-13 20:55:22发表:
支持一下吧。
Fromlung 于 2009-04-13 11:54:08发表:
(e:e2s佩服