#/bin/bash
#System Configuration Steps:
#Created by ritto.zhao
#MSN:
#12.15.2008 学习笔记
#Kernel 2.6+、CentOS 5.2
#Change gateway
sed -i 's#GATEWAY=192.168.4.1#GATEWAY=192.168.4.3#' /etc/sysconfig/network
/etc/init.d/network restart
#Disable IPv6
cp /etc/modprobe.conf /etc/modprobe.conf.bak
echo "alias net-pf-10 off" >> /etc/modprobe.conf
echo "alias ipv6 off" >> /etc/modprobe.conf
#Disable selinux
cp /etc/sysconfig/selinux /etc/sysconfig/selinux.bak
sed -i 's#SELINUX=enforcing#SELINUX=disabled#' /etc/sysconfig/selinux
#Set system time
yum -y install ntp
/usr/sbin/ntpdate cn.pool.ntp.org
#/usr/sbin/ntpdate 210.72.145.44 && clock -w
echo "/usr/sbin/ntpdate cn.pool.ntp.org && clock -w" >> /etc/rc.local
#Stop unuseful services
chkconfig --list | grep 3:on | awk '{print $1}' | egrep -v 'sshd|network|syslog' | xargs -i{} chkconfig --level 3 {} off
chkconfig --list | grep 3:on | cut -f1
reboot
-------------------------------------------------------------
#Load cdrom
mount /dev/cdrom /media
#Set yum source use local cdrom
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak
mv CentOS-Media.repo CentOS-Media.repo.bak
vi dvdiso.repo
[DVDISO]
name=DVD ISO
baseurl=file:///media/
enable=1
gpgcheck=0
-------------------------------------------------------------
#Yum source in internet
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save
wget