#!/bin/bash
set -e
sudo apt-get install vsftpd -y
sudo service vsftpd start
ftpconfigfile=/etc/vsftpd.conf
sed -i 's/anonymous_enable=YES/anonymous_enable=NO/g' ${ftpconfigfile}
sed -i 's/local_enable=NO/local_enable=YES/g' ${ftpconfigfile}
sed -i 's/#local_enable=YES/local_enable=YES/g' ${ftpconfigfile}
sed -i 's/write_enable=NO/write_enable=YES/g' ${ftpconfigfile}
sed -i 's/#write_enable=YES/write_enable=YES/g' ${ftpconfigfile}
sed -i 's/utf8_filesystem=NO/utf8_filesystem=YES/g' ${ftpconfigfile}
sed -i 's/#utf8_filesystem=YES/utf8_filesystem=YES/g' ${ftpconfigfile}
sed -i '$a local_umask=022' ${ftpconfigfile}
sudo service vsftpd restart
echo "install vsftp over！"
