pureftpd自启动脚本-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 6315279
  • 博文数量: 162
  • 博客积分: 3600
  • 博客等级: 中校
  • 技术积分: 10366
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-19 11:23
个人简介

专注系统运维、网络架构,研究技术凯发app官方网站的解决方案,记录我的思想轨迹、工作学习、生活和关注的领域

文章分类
文章存档

2014年(2)

2013年(16)

2012年(27)

2011年(117)

相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: 系统运维

2011-02-26 10:16:34

配置完pureftpd后,启动它需要写全路径,如果想像启动系统服务那样 service  服务  start  等,下面的脚本就能够实现!
#!/bin/sh
#
# scriptname: /etc/init.d/pureftpd
# chkconfig: - 60 50
# description: pureftpd is a ftp daemon, which is the program \
# that answers incoming ftp service requests.
# processname: pureftpd
#
# author : cnscn
# time : 2006-04-18 09:30
#

#tput func
functput()
{
tput init
for args
do
case "$args" in
green_black)
echo -e -n "\033[;32m"
;;
red_black)
echo -e -n "\033[;31m"
;;
endtput)
tput sgr0
esac
done
}

case "$1" in
start)
ps aux | grep pure-ftp | grep -v grep > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo -n "pureftpd has already been running ... "
functput red_black
echo "[failed]"
functput endtput
exit 1
fi
echo -n "start pureftpd.... "
/usr/local/pureftpd/bin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf > /dev/null 2>&1
if [ $? -eq 0 ] ; then
functput green_black
echo " [ok]"
functput endtput
else
functput red_black
echo " [failed] ";
functput endtput
fi
;;
stop)
ps aux | grep pure-ftp | grep -v grep > /dev/null 2>&1
if [ $? -eq 1 ]
then
echo -n "pureftpd has not been runned now ... "
functput red_black
echo "[failed]"
functput endtput
exit 1
fi
echo -n "stop pureftpd... "
killall pure-ftpd > /dev/null 2>&1
if [ $? -eq 0 ] ; then
functput green_black
echo " [ok]"
functput endtput
else
functput red_black
echo " [failed] ";
functput endtput
fi
;;
restart)
ps aux | grep pure-ftp | grep -v grep > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo -n "stop pureftpd... "
killall pure-ftpd > /dev/null 2>&1
if [ $? -eq 0 ] ; then
functput green_black
echo " [ok]"
functput endtput
else
functput red_black
echo " [failed] ";
functput endtput
fi
fi

echo -n "start pureftpd.... "
/usr/local/pureftpd/bin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf >/dev/null 2>&1
if [ $? -eq 0 ] ; then
functput green_black
echo " [ok]"
functput endtput
else
functput red_black
echo " [failed] ";
functput endtput
fi
;;
*)
echo "usage: `basename $0` {start | stop | restart}"
;;
esac
exit 0
阅读(4158) | 评论(0) | 转发(3) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图