#!/bin/bash tft_conf="/etc/xinetd.d/tftp" backup_dir="/network/sw_backup" if [ -d {backup_dir} ] then echo "$backup_dir has been exist! " else mkdir -pv $backup_dir chmod -R 777 $backup_dir fi if [ -f ${tft_conf} ] then echo "The tftpserver has been exist!" else yum install tftp tftp-server -y if [ $? -eq 0 ] then echo "tftserver install sucessful! " else echo "tftservr install faild !" echo "please check your env !" exit 1 fi fi echo "config the tftpserver ......" sed -i '/disable/s/yes/no/g' $tft_conf sed -i '/server_args/s#-s /tftpboot#-s /network/sw_backup -c#g' $tft_conf chkconfig tftp on chkconfig xinetd on /etc/init.d/xinetd restart