1、初始化系统

#!/bin/bash
mkdir /mnt/cdrom
echo "/dev/cdrom        /mnt/cdrom      iso9660         defaults        0 0">>/etc/fstab
mount -a
rm /etc/yum.repos.d/*
echo '[base]
name=base
enabled=1
baseurl=file:///mnt/cdrom
gpgcheck=0'>/etc/yum.repos.d/base.repo
yum install -y vim xorg-x11-xauth openssh-clients
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
cp /etc/sysconfig/selinux /etc/sysconfig/selinux.bk
echo 'SELINUX=disabled
SELINUXTYPE=targeted'>/etc/sysconfig/selinux
cat /etc/sysconfig/selinux
cat /etc/yum.repos.d/base.repo
getenforce
systemctl status firewalld