rpm -q tftp-server &>/dev/null && restart_tftp || { yum -y install tftp-server &>/dev/null;restart_tftp; }
rpm -q tftp &>/dev/null || yum -y install tftp &>/dev/null;
#For centos 6.9,file pxelinux.0 comes from packges syslinux-nonlinux,other version is from syslinux,but if you install packge syslinux,it will also install syslinux-nonlinux packge,so just install syslinux packge is OK to get file syslinux-nonlinux.
rpm -q syslinux &>/dev/null || yum -y install syslinux &>/dev/null;
#set http for yum server
#mount yum source
echo "Now you need to config yum server in http server"
echo "Since I do not know which different disc your disc will be displayed,such as,centos7 display as /dev/sr0,or display as/dev/sr1 or other device "
echo "This time,I have three disks,6i386 means 386 arch for ceentos6.5,6x86_64 means 64bit for centos6.9,7 means centos7.3"
echo "the relation of my disk dislay in the centos as below"
echo -e "/dev/sr0 ---> 6x86_64 \n/dev/sr1 ---> 6i386 \n/dev/sr2 ---> 7"
mkdir -p /var/www/html/os/{6i386,6x86_64,7}
read -p "Would you want to mount disk auto:(eg:y/n): " automount
case $automount in
y)
echo -e "/dev/sr0 ---> 6x86_64 \n/dev/sr1 ---> 6i386 \n/dev/sr2 ---> 7"
mount /dev/sr0 /var/www/html/os/6x86_64
mount /dev/sr1 /var/www/html/os/6i386
mount /dev/sr2 /var/www/html/os/7
;;
*)
echo "Since your answer is no or other,please mount disk after the script end"
echo "eg: run mount /dev/sr0 /var/www/html/os/6x86_64 "