是基于VMware虛擬機上安裝實驗的!
江都ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:13518219792(備注:SSL證書合作)期待與您的合作!
#!/bin/bash
#修改IP地址????????????
#sed -i 's/dhcp/static/' /etc/sysconfig/network-scripts/ifcfg-ens32
#echo "
#IPADDR=192.168.100.100
#NETMASK=255.255.255.0" >> /etc/sysconfig/network-scripts/ifcfg-ens32
#systemctl restart network
#配置本地yum
#mount /dev/cdrom /mnt
#mkdir /etc/yum.repos.d/bak && mv /etc/yum.repos.d/C* /etc/yum.repos.d/bak
#echo "
#[base]
#name=base
#baseurl=file:///mnt
#gpgcheck=0
#enabled=1" >> /etc/yum.repos.d/base.repo
#yum clean all && yum list
#安裝dhcp,配置dhcp配置文件
[ ! -e /etc/dhcp/dhcpd.conf ] && echo "沒有安裝DHCP服務,現(xiàn)在安裝!"; yum -y install dhcp ?
echo? " subnet 192.168.220.0 netmask 255.255.255.0 {
?? ??? ?range 192.168.220.10 192.168.220.20;
?? ??? ?option routers 192.168.220.115;
#?? ??? ?option domain-name-servers 114.114.114.114;
?? ??? ?next-server 192.168.220.115;
?? ??? ?filename \"pxelinux.0\" ;
?? ??? ?}" > /etc/dhcp/dhcpd.conf
#安裝tftp和修改配置文件
[ ! -e /etc/xinetd.d/tftp ] && echo "沒有安裝TFTP,現(xiàn)在安裝!";yum -y install tftp-server
sed -i '/disable/s/yes/no/' /etc/xinetd.d/tftp
#安裝syslinux
[ ! -e /usr/share/syslinux/pxelinux.0 ] && yum -y install syslinux
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
#安裝ftp
[ ! -e /etc/vsftpd/vsftpd.conf ] && yum -y install vsftpd
mkdir /var/ftp/centos7
#umount /mnt && mount /dev/cdrom /var/ftp/centos7/
mount /dev/cdrom /var/ftp/centos7/
cp /var/ftp/centos7/images/pxeboot/vmlinuz /var/lib/tftpboot/
cp /var/ftp/centos7/images/pxeboot/initrd.img /var/lib/tftpboot/
echo "
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --plaintext 123
# System language
lang zh_CN
# Firewall configuration
firewall --disabled
# System authorization information
auth? --useshadow? --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
firstboot --disable
# SELinux configuration
selinux --disabled
# Network information
network? --bootproto=dhcp --device=ens32
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all
# Disk partitioning information
part /boot --fstype="xfs" --size=500
part /home --fstype="xfs" --size=2048
part swap --fstype="swap" --size=2048
part / --fstype="xfs" --grow --size=1
%packages
@^gnome-desktop-environment
@base
@core
@desktop-debugging
@dial-up
@directory-client
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@input-methods
@internet-browser
@java-platform
@multimedia
@network-file-system-client
@networkmanager-submodules
@print-client
@x11
chrony
kexec-tools
%end " > /var/ftp/ks.cfg
#配置編輯default啟動菜單
mkdir /var/lib/tftpboot/pxelinux.cfg
echo "
default auto
prompt 1
label auto
??????? kernel vmlinuz
??????? append initrd=initrd.img method=ftp://192.168.220.115/centos7 ks=ftp://192.168.220.115/ks.cfg
label linux text
??????? kernel vmlinuz
??????? append text initrd=initrd.img method=ftp://192.168.220.115/centos7
label linux rescue
??????? kernel vmlinuz
??????? append rescue initrd=initrd.img method=ftp://192.168.220.115/centos7
" > /var/lib/tftpboot/pxelinux.cfg/default
setenforce 0
systemctl stop firewalld
systemctl start tftp
systemctl start dhcpd
systemctl start vsftpd
分享標題:pxe自動值守腳本
瀏覽地址:http://aaarwkj.com/article4/igghie.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供關鍵詞優(yōu)化、App開發(fā)、移動網(wǎng)站建設、定制網(wǎng)站、建站公司、用戶體驗
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)