#!/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) |