Personally wrote a shell script after the discovery, this thing is really convenient when you want to change some trivial details of a small one-time instruction to complete, the script is the best choice, convenient, fast, the key is really lazy essential ah.
As the installation of CentOS6.5 is to minimize installation and experimental environment, that is installed in vmware workstations above, after the initial installation is complete, the configuration information about IP addresses after completion, to do an initial snapshot for the next experiment after, you can quickly restore the system snapshot.
However, due to the requirements of the experimental environment, such as a firewall, SELinux, disc mount, yum source configuration, are most often need to modify the options, and because minimal installation, the system does not vim build tools and man manual query, lead after restoring snapshot, but also to deal with these issues every trivial. To this end, I specifically wrote a small script such, are not complicated, but it is also a learning process, and issued to share with everyone, seek advice by the way ......
#! / Bin / bash
# Config some simple order when the system start
# Create by phoenix
# Specify the path
server = / etc / init.d
yum = / etc / yum.repos.d
mountdir = / media / cdrom
selinux = / etc / selinux / config
# Stop the iptabes and set it can not start when the system start
$ Server / iptables stop &> / dev / null
if [ "? $" = "0"]; then
chkconfig iptables off
chkconfig ip6tables off
echo "1 # The iptables stop successfully"
echo "1 # The iptables stop failed"
# Shutdown the selinxu system
setenforce 0 && sed -e 's / ^ SELINUX = enforcing / SELINUX = disabled / g' $ selinux> $ selinux.bak
mv -f $ selinux.bak $ selinux
echo "2 # The selinux system is disabled"
# Mount the CD-ROM
mount | grep sr0 &> / dev / null
if [! "? $" = "0"]; then
if [! -e $ mountdir]; then
mkdir -p $ mountdir &> / dev / null
mount / dev / cdrom $ mountdir &> / dev / null
echo "3 # The CD-ROM is mounting successfully"
echo "3 # The CD-ROM is already mounted"
# Config the source of yum
if [-e $ yum / CentOS-Base.repo]; then
mv -f $ yum / CentOS-Base.repo $ yum / CentOS-Base.repo.bak &> / dev / null
echo "4 # Starting config the source of yum"
sed -e 's / ^ enabled = 0 / enabled = 1 / g' $ yum / CentOS-Media.repo> $ yum / CentOS-Media.repo.bak
mv -f $ yum / CentOS-Media.repo.bak $ yum / CentOS-Media.repo >> / dev / null
yum clean all &> / dev / null && echo "5 # The source of yum configed successfully"
# Modify the code of language
echo "# LANG = zh_CN.UTF-8"> / etc / sysconfig / i18n
echo "6 # The language is modify successfully"
# Install the tools "VIM" and "MAN"
echo "7 # Starting install vim and man, please wait ......"
yum install vim man -y &> / dev / null
# Reboot the system when all the work is done
echo "######### All work is done ########"
echo "Please wait the syatem restart ......"