echo "copy the kernel file to the relative dir,such as cp /var/www/html/os/6i386/isolinux/{initrd.img,vmlinuz} /var/lib/tftpboot/6i386"
echo "If you have many other yum source,please create relative dir under /var/lib/tftpboot/6i386"
;;
esac
cp /usr/share/syslinux/{pxelinux.0,menu.c32} /var/lib/tftpboot/
echo "Now config defaults file ,you can copy the host relative disk file ,/media/isolinux/isolinux.cfg to /var/lib/tftpboot/pxelinux.cfg,and rename it to defaults,and the modify the config,run cmd 'cp /media/isolinux/isolinux.cfg /var/lib/tftpboot/ pxelinux.cfg/default' "
echo "Now I will config /var/lib/tftpboot/pxelinux.cfg/default"
mkdir /var/lib/tftpboot/pxelinux.cfg
cat > /var/lib/tftpboot/pxelinux.cfg/default<<eof
default menu.c32
#prompt 1
timeout 80
display boot.msg
menu background splash.jpg
menu title Welcome to Sunny diy install Linux!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000
label desktop73
menu label Install diy ^desktop centos 7
menu default
kernel 7/vmlinuz
append initrd=7/initrd.img ks=http://$ip/ksdir/ks73desk.cfg
label mini73
menu label Install diy ^mini centos 7
menu default
kernel 7/vmlinuz
append initrd=7/initrd.img ks=http://$ip/ksdir/ks73min.cfg
label desktop6.5
menu label Installed d^esktop centos 6.5 i386
kernel 6i386/vmlinuz
append initrd=6i386/initrd.img ks=http://$ip/ksdir/ks65desk.cfg
label mini6.5
menu label Install m^ini centos 6.5 i386
kernel 6i386/vmlinuz
append initrd=6i386/initrd.img ks=http://$ip/ksdir/ks65min.cfg
label desktop6.9
menu label Installed de^sktop centos 6.9
kernel 6x86_64/vmlinuz
append initrd=6x86_64/initrd.img ks=http://$ip/ksdir/ks69desk.cfg
label mini6.9
menu label Install mi^ni centos 6.9
kernel 6x86_64/vmlinuz
append initrd=6x86_64/initrd.img ks=http://$ip/ksdir/ks69min.cfg
eof
echo "tftp is config OK"
#restart server
echo "now restart server"
restart_httpd;
restart_tftp;
restart_dhcpd;
netstat -ntulp | grep dhcpd | grep :67 &>/dev/null && echo "dhcp is running..." || echo "dhcp is not run,please check"
netstat -ntulp | grep httpd | grep :80 &>/dev/null && echo "http is running..." || echo "http is not run,please check"
netstat -ntulp | grep xinetd | grep 69 &>/dev/null && echo "tftp is running..." || echo "tftp is not run,please check"
5 小结