[packages] proftpd: update to 1.3.3, add standalone init script, comment out UseIPv6...
[packages.git] / net / proftpd / files / proftpd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2010 OpenWrt.org
3
4 START=50
5
6 BIN=/usr/sbin/proftpd
7 HOME=/home/ftp
8 RUN_D=/var
9 PID_F=$RUN_D/proftpd.pid
10 RUN_USER=ftp
11 RUN_GROUP=$RUN_USER
12
13 EXTRA_COMMANDS="suspend resume"
14 EXTRA_HELP="    suspend Suspend the service
15         resume  Resume the service"
16
17 start() {
18         [ -d $HOME ] || ( mkdir -p $HOME && chown $RUN_USER:$RUN_GROUP $HOME )
19
20         [ ! -f $PID_F ] && $BIN
21 }
22
23 stop() {
24         [ -f $PID_F ] && kill $(cat $PID_F)
25 }
26
27 reload() {
28         [ -f $PID_F ] && kill -HUP $(cat $PID_F)
29 }
30
31 suspend() {
32         echo "Suspending NOW"
33         ftpshut now "Maintenance in progress"
34 }
35
36 resume() {
37         [ -f /etc/shutmsg ] && {
38                 echo "Allowing sessions again"
39                 ftpshut -R > /dev/null
40         }
41 }