packages/net/proftpd/files/proftpd.init
swalker 2975b92b3f [packages] proftpd: update to 1.3.3, add standalone init script, comment out UseIPv6 when IPv6 is disabled
git-svn-id: svn://svn.openwrt.org/openwrt/packages@19991 3c298f89-4303-0410-b956-a3cf2f4a3e73
2010-03-05 11:34:19 +00:00

42 lines
671 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2010 OpenWrt.org
START=50
BIN=/usr/sbin/proftpd
HOME=/home/ftp
RUN_D=/var
PID_F=$RUN_D/proftpd.pid
RUN_USER=ftp
RUN_GROUP=$RUN_USER
EXTRA_COMMANDS="suspend resume"
EXTRA_HELP=" suspend Suspend the service
resume Resume the service"
start() {
[ -d $HOME ] || ( mkdir -p $HOME && chown $RUN_USER:$RUN_GROUP $HOME )
[ ! -f $PID_F ] && $BIN
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}
reload() {
[ -f $PID_F ] && kill -HUP $(cat $PID_F)
}
suspend() {
echo "Suspending NOW"
ftpshut now "Maintenance in progress"
}
resume() {
[ -f /etc/shutmsg ] && {
echo "Allowing sessions again"
ftpshut -R > /dev/null
}
}