随笔

#!/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

 

 

posted @ 2014-04-22 01:45  osxlinux  阅读(141)  评论(0编辑  收藏  举报