<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post/975/</link>
<title><![CDATA[CentOS ProFtpd 一键安装脚本]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[服务器类]]></category>
<pubDate>Wed, 15 Feb 2017 07:59:23 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post/975/</guid> 
<description>
<![CDATA[ 
	<textarea name="code" class="c" rows="15" cols="100">#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

# Check if user is root
if [ $(id -u) != &quot;0&quot; ]; then
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Error: You must be root to run this script!&quot;
&nbsp;&nbsp;&nbsp;&nbsp;exit 1
fi
clear
echo &quot;+----------------------------------------------------------+&quot;
echo &quot;&#124;Author:jingyihome&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;&quot;
echo &quot;+----------------------------------------------------------+&quot;
echo &quot;&#124;E-mail:webmaster@zhanghaijun.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&quot;
echo &quot;+----------------------------------------------------------+&quot;
echo &quot;&#124;Website:http://www.zhanghaijun.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&quot;
echo &quot;+----------------------------------------------------------+&quot;
echo &quot;&#124;Usage: ./proftpd.sh or ./proftpd.sh install&#124;uninstall&nbsp;&nbsp;&nbsp;&nbsp; &#124;&quot;
echo &quot;+----------------------------------------------------------+&quot;
cur_dir=$(pwd)

Proftpd_Ver=&#039;proftpd-1.3.6rc2&#039;
installdir=&quot;/usr/local/proftpd&quot;

Install_Proftpd()
&#123;
&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[32m Installing dependent packages... &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yum -y install make gcc gcc-c++ gcc-g77 openssl openssl-devel wget

&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[32m Download files... &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;cd $&#123;cur_dir&#125;/
&nbsp;&nbsp;&nbsp;&nbsp;wget --no-check-certificate https://soft.loveyan.com/ftp/proftpd/$&#123;Proftpd_Ver&#125;.tar.gz $&#123;cur_dir&#125;/$&#123;Proftpd_Ver&#125;.tar.gz
&nbsp;&nbsp;&nbsp;&nbsp;if [ $? -eq 0 ]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Download $&#123;Proftpd_Ver&#125;.tar.gz successfully!&quot;
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wget ftp://ftp.proftpd.org/distrib/source/$&#123;Proftpd_Ver&#125;.tar.gz $&#123;cur_dir&#125;/$&#123;Proftpd_Ver&#125;.tar.gz
&nbsp;&nbsp;&nbsp;&nbsp;fi

&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[32m Installing proftpd... &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;tar xzvf $&#123;Proftpd_Ver&#125;.tar.gz $&#123;Proftpd_Ver&#125;
&nbsp;&nbsp;&nbsp;&nbsp;cd $&#123;Proftpd_Ver&#125;
&nbsp;&nbsp;&nbsp;&nbsp;./configure --prefix=$&#123;installdir&#125;

&nbsp;&nbsp;&nbsp;&nbsp;make &amp;&amp; make install

&nbsp;&nbsp;&nbsp;&nbsp;cd $&#123;cur_dir&#125;/
&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[32m Create configure files... &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;mv $&#123;installdir&#125;/etc/proftpd.conf $&#123;installdir&#125;/etc/bak_proftpd.conf
&nbsp;&nbsp;&nbsp;&nbsp;wget --no-check-certificate https://soft.loveyan.com/ftp/proftpd/proftpd.conf
&nbsp;&nbsp;&nbsp;&nbsp;if [ $? -eq 0 ]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sed -i &quot;s#/usr/local/ftp/proftpd#$&#123;installdir&#125;#g&quot; $&#123;cur_dir&#125;/proftpd.conf
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv $&#123;cur_dir&#125;/proftpd.conf $&#123;installdir&#125;/etc/
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[31m Download proftpd.conf failed! &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit 1
&nbsp;&nbsp;&nbsp;&nbsp;fi

&nbsp;&nbsp;&nbsp;&nbsp;if [ -L /etc/init.d/proftpd ]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rm -f /etc/init.d/proftpd
&nbsp;&nbsp;&nbsp;&nbsp;fi

&nbsp;&nbsp;&nbsp;&nbsp;wget --no-check-certificate https://soft.loveyan.com/ftp/proftpd/proftpdinit
&nbsp;&nbsp;&nbsp;&nbsp;if [ $? -eq 0 ]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sed -i &quot;s#/usr/local/ftp/proftpd#$&#123;installdir&#125;#g&quot; $&#123;cur_dir&#125;/proftpdinit
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv $&#123;cur_dir&#125;/proftpdinit /etc/init.d/proftpd
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chmod +x /etc/init.d/proftpd
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; touch $&#123;installdir&#125;/etc/ftpd.passwd
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chmod 600 $&#123;installdir&#125;/etc/ftpd.passwd
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[31m Download proftpdinit failed! &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit 1
&nbsp;&nbsp;&nbsp;&nbsp;fi

&nbsp;&nbsp;&nbsp;&nbsp;rm -rf $&#123;cur_dir&#125;/$&#123;Proftpd_Ver&#125;

&nbsp;&nbsp;&nbsp;&nbsp;if [ -s /sbin/iptables ]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /sbin/iptables -I INPUT -p tcp --dport 50000:53000 -j ACCEPT
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo -e &quot;&#92;033[32m iptables was not installed! &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;fi

&nbsp;&nbsp;&nbsp;&nbsp;service iptables save

&nbsp;&nbsp;&nbsp;&nbsp;if [[ -s $&#123;installdir&#125;/sbin/proftpd &amp;&amp; -s $&#123;installdir&#125;/etc/proftpd.conf &amp;&amp; -s /etc/init.d/proftpd ]]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Starting proftpd...&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc/init.d/proftpd start
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ln -s $&#123;installdir&#125;/bin/ftpasswd /bin/ftpasswd
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;+----------------------------------------------------------------------------------------------------------------------------+&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&#124; Install ProFTPd completed,enjoy it!&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&#124; =&gt;use:ftpasswd --passwd --file=$&#123;installdir&#125;/etc/ftpd.passwd --name=X --uid=X --gid=X --home=dir --shell=/bin/false&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;+----------------------------------------------------------------------------------------------------------------------------+&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;&#124; For more information please visit http://www.zhanghaijun.com/post/975/&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;+----------------------------------------------------------------------------------------------------------------------------+&quot;
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[31m Proftpd install failed! &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;fi
&#125;

Uninstall_Proftpd()
&#123;
&nbsp;&nbsp;&nbsp;&nbsp;if [ ! -f $installdir/sbin/proftpd ]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[31m Proftpd was not installed! &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit 1
&nbsp;&nbsp;&nbsp;&nbsp;fi
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Stop proftpd...&quot;
&nbsp;&nbsp;&nbsp;&nbsp;/etc/init.d/proftpd stop
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Remove service...&quot;
&nbsp;&nbsp;&nbsp;&nbsp;rm -f /etc/init.d/proftpd
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Delete files...&quot;
&nbsp;&nbsp;&nbsp;&nbsp;rm -rf $&#123;installdir&#125;
&nbsp;&nbsp;&nbsp;&nbsp;rm -rf /bin/ftpasswd
&nbsp;&nbsp;&nbsp;&nbsp;/sbin/iptables -D INPUT -p tcp --dport 21 -j ACCEPT
&nbsp;&nbsp;&nbsp;&nbsp;/sbin/iptables -D INPUT -p tcp --dport 50000:53000 -j ACCEPT
&nbsp;&nbsp;&nbsp;&nbsp;service iptables save
&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Proftpd uninstall completed.&quot;
&#125;

action=$1
[ -z $1 ] &amp;&amp; action=install
case &quot;$action&quot; in
install)
&nbsp;&nbsp;&nbsp;&nbsp;Install_Proftpd 2&gt;&amp;1 &#124; tee /root/proftpd-install.log
&nbsp;&nbsp;&nbsp;&nbsp;;;
uninstall)
&nbsp;&nbsp;&nbsp;&nbsp;Uninstall_Proftpd
&nbsp;&nbsp;&nbsp;&nbsp;;;
*)
&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[31m error! [$&#123;action&#125;] &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;echo -e &quot;&#92;033[32m Usage: `basename $0` &#123;install&#124;uninstall&#125; &#92;033[0m&quot;
&nbsp;&nbsp;&nbsp;&nbsp;;;
esac
</textarea><br/>Tags - <a href="http://www.zhanghaijun.com/tags/centos/" rel="tag">centos</a> , <a href="http://www.zhanghaijun.com/tags/proftpd/" rel="tag">proftpd</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post/975/#blogcomment2501</link>
<title><![CDATA[[评论] CentOS ProFtpd 一键安装脚本]]></title> 
<author>abc91236abc &lt;m18361182716@163.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 03 Mar 2017 10:36:48 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post/975/#blogcomment2501</guid> 
<description>
<![CDATA[ 
	苏州华硕电脑电子有限公司，因生产线扩大特向社会招纳电子操作工若干名，无技术要求（长期工短期工都可以，短期工必须做满1个月）<br/>招聘要求，年龄18到40岁，男女不限，初中以上学历，身体健康，无传染病，无犯罪记录，持有本人有效身份证，都可录用。工作时间，公司实行八小时工作制，八小时之外算加班，加班每小时二十元。<br/>薪资待遇：正常操作工月工资达到3800元至4500元之间，（保证不忽悠人）公司待遇，公司免费提供员工吃住，伙食很好，公司自建员工宿舍，六人一间宿舍，有独立卫生间，热水器空调，公司每月10号发工次，统一打到员工工资卡上公司地址：苏州市枫桥街道<br/>招聘热线：15851430570&nbsp;&nbsp;张经理。
]]>
</description>
</item>
</channel>
</rss>