pure-ftpd腳本安裝

 

  1. #!/bin/bash  
  2. PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin  
  3. export PATH  
  4. if [ $(id -u) != "0" ]; then  
  5.     quit "You must be root to run this script!"  
  6. fi  
  7. cur_dir=`pwd`  
  8. #download pure-ftpd   
  9. cd $cur_dir  
  10. if [ -s pure-ftpd-1.0.36.tar.gz ]; then  
  11.     echo "pure-ftpd-1.0.36.tar.gz [found]"  
  12. else  
  13.     echo "pure-ftpd-1.0.36.tar.gz not found!!!download now......"  
  14.     if ! wget -c http://teddysun.googlecode.com/files/pure-ftpd-1.0.36.tar.gz;then  
  15.         echo "Failed to download pure-ftpd-1.0.36.tar.gz,please download it to /lamp directory manually and rerun the install script."  
  16.         exit 1  
  17.     fi  
  18. fi  
  19.  
  20. #install pure-ftpd   
  21. echo "============================pure-ftpd  install============================================"  
  22. tar xzf pure-ftpd-1.0.36.tar.gz  
  23. cd pure-ftpd-1.0.36  
  24. ./configure  
  25. make && make install  
  26. cp -pr contrib/redhat.init /etc/init.d/pure-ftpd  
  27. chmod 755 /etc/init.d/pure-ftpd  
  28. chkconfig --add pure-ftpd  
  29. chkconfig --level 3 pure-ftpd on  
  30. cp -pr configuration-file/pure-ftpd.conf.in /etc/pure-ftpd.conf  
  31. cp -pr configuration-file/pure-config.pl /usr/local/sbin/pure-config.pl  
  32. chmod 744 /etc/pure-ftpd.conf  
  33. chmod 755 /usr/local/sbin/pure-config.pl  
  34. service pure-ftpd start  
  35. #see if iptables is start  
  36. /sbin/service iptables status 1>/dev/null 2>&1  
  37. if [ $? -eq 0 ]; then  
  38. /sbin/iptables -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT    
  39. /etc/rc.d/init.d/iptables save  
  40. echo 'IPTABLES_MODULES="ip_conntrack_ftp">>/etc/sysconfig/iptables-config  
  41. /etc/init.d/iptables restart  
  42. fi  
  43. echo "============================pure-ftpd install completed============================================"  

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章