Chinaunix首页 | 论坛 | 博客
  • 博客访问: 245115
  • 博文数量: 35
  • 博客积分: 2146
  • 博客等级: 大尉
  • 技术积分: 875
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-11 22:17
文章分类

全部博文(35)

文章存档

2012年(1)

2011年(1)

2010年(4)

2009年(12)

2008年(17)

我的朋友

分类: LINUX

2009-03-24 09:29:09

#!/bin/bash
#    这是一个基于redhat as的更新与安装软件服务器初始化
#this is a redhat as5 update server build script
# mail me:zhanghaifeng@seaskyjoy.com or
#
tar xvf yumserver.tar.gz
rpm -ivh rpm/yum-3.0.*.rpm
rpm -ivh rpm/yum-metadata-parser*.rpm
rpm -ivh rpm/yum-rhn-plugin*.rpm
rpm -ivh rpm/yum-arch*.rpm
rpm -ivh rpm/yum-updatesd*.rpm
rpm -ivh rpm/createrepo*.rpm
rpm -ivh rpm/yum-ar*.rpm
rpm -ivh rpm/apr-1.*.i386.rpm
rpm -ivh rpm/post*.i386.rpm
rpm -ivh rpm/apr-ut*.i386.rpm
/etc/init.d/httpd start
#拷贝光盘资料到 mnt/cdrom1
#mount install dvd to /mnt/cdrom1
#
mkdir  /mnt/cdrom1
mount -t iso9660 /dev/cdrom /mnt/cdrom1
mkdir -p /var/www/html/rhs
cp -r /mnt/cdrom1/Server /var/www/html/rhs/
#cp -r /mnt/cdrom1/rhc/Server /var/www/html/rhs/
cp /mnt/cdrom1/RPM-GPG-KEY-redhat-release /var/www/html/rhs/Server &
#
#...web.....
chmod 777 -R /var/www/html/rhs
chown apache:apache -R /var/www/html/rhs
rm -rf /var/www/html/rhs/Server/.olddata
#..yum-arch
#
yum-arch /var/www/html/rhs/Server
createrepo /var/www/html/rhs/Server
#
#
# ..yum.conf
echo [Server] >> /etc/yum.conf
echo gpgkey= >> /etc/yum.conf
echo baseurl= >> /etc/yum.conf
#.....
mkdir -p /etc/yum.repos.d/backup
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
echo [Server] >> /etc/yum.repos.d/Server.repo
echo name=Red Hat as5  >> /etc/yum.repos.d/Server.repo
echo baseurl=  >> /etc/yum.repos.d/Server.repo
echo gpgcheck=1 >> /etc/yum.repos.d/Server.repo
echo gpgkey= >> /etc/yum.repos.d/Server.repo
阅读(945) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~