标签:res net emc dev oca base dir load 系统
#!/bin/bash #检查环境 setenforce 0 sed -i ‘s/=enforce/=disabled/g‘ /etc/selinux/config systemctl restart firewalld #配置yum源 cd /etc/yum.repos.d mkdir bak mv *.repo bak mkdir /dvd mount /dev/cdrom /dvd cat > /etc/yum.repos.d/1.repo <<EOF [dvd] name=dvd baseurl=file:///dvd enabled=1 gpgcheck=0 EOF yum clean all yum makecache #安装dhcp yum -y install dhcp cat > /etc/dhcp/dhcpd.conf <<EOF default-lease-time 600; max-lease-time 7200; log-facility local7; subnet 192.168.200.0 netmask 255.255.255.0 { range 192.168.200.100 192.168.200.200; option routers 192.168.200.12; filename \"pxelinux.0"\; next-server 192.168.200.12; } EOF systemctl restart dhcpd #安装tftp yum -y install tftp-server xinetd vim /etc/xinetd.d/tftp sed -i ‘13s/= -s /var/lib/tftpboot/= -s /tftpboot/g‘ /etc/xinetd.d/tftp sed -i ‘14s/= yes/= no/g‘ /etc/xinetd.d/tftp systemctl restart xinetd #安装http yum -y install httpd syslinux rm -fr /etc/httpd/conf.d/welcome.conf mkdir /var/www/html/iso mount /dev/cdrom /var/www/html/iso/ cat >> /etc/fstab <<EOF /dev/cdrom/ /var/www/htm/iso iso9660 defaults 0 0 EOF #制作光盘系统 mkdir /tftpboot cp /var/www/html/iso/isolinux/vmlinuz /tftpboot/ cp /www/html/iso/isolinux/initrd.img /tftpboot/ mkdir /tftpboot/pxelinux.cfg cp /var/www/html/iso/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default cp /usr/share/syslinux/pxelinux.0 /tftpboot/ sed -i ‘1s/vesamenu.c32/ks/g‘ /tftpboot/pxeinux.cfg/default sed -i ‘60a label ks menu label ^Install CentOS 7 kernel vmlinuz append initrd=initrd.img append initrd=initrd.img method=http://192.168.200.12/iso ks=http://192.168.200.12/ks.cfg devfs=nomount‘ cp /root/anaconda-ks.cfg /var/www/html/ks.cfg sed -i ‘5s/cdrom/install/g‘ /var/www/html/ks.cfg sed -i ‘6a url --url=\"http://192.168.200.12/iso"\‘ /var/www/html/ks.cfg chmod /var/www/html/ks.cfg #添加防火墙 systemctl enable dhcpd xinetd httpd systemctl restart dhcpd xinetd httpd firewall-cmd --add-port=67/udp --permanent firewall-cmd --add-port=69/udp --permanent firewall-cmd --add-port=80/tcp --permanent firewall-cmd --reload
标签:res net emc dev oca base dir load 系统
原文地址:https://www.cnblogs.com/twoo/p/11633459.html