1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006-2011 OpenWrt.org
6 PIDF
=/var
/run
/pure-ftpd.pid
7 PROG
=/usr
/sbin
/pure-ftpd
14 config_get_bool _val
"$section" "$option" '0'
15 [ "$_val" -gt 0 ] && append args
"$3"
23 config_get _val
"$section" "$option"
24 [ -n "$_val" ] && append args
"$3 $_val"
31 append_string
"$section" trustedgid
"-a"
32 append_string
"$section" syslogfacility
"-f"
33 append_string
"$section" fortunesfile
"-F"
34 append_string
"$section" maxidletime
"-I"
35 append_string
"$section" maxdiskusagepct
"-k"
36 append_string
"$section" limitrecursion
"-L"
37 append_string
"$section" anonymouscancreate
"-M"
38 append_string
"$section" maxload
"-m"
39 append_string
"$section" quota
"-n"
40 append_string
"$section" altlog
"-O"
41 append_string
"$section" passiveportrange
"-p"
42 append_string
"$section" forcepassiveip
"-P"
43 append_string
"$section" anonymousratio
"-q"
44 append_string
"$section" userratio
"-Q"
45 append_string
"$section" anonymousbandwidth
"-t"
46 append_string
"$section" userbandwidth
"-T"
47 append_string
"$section" minuid
"-u"
48 append_string
"$section" trustedip
"-V"
49 append_string
"$section" tls
"-Y"
50 append_string
"$section" tlsciphersuite
"-J"
52 append_bool
"$section" uploadscript
"-o"
53 append_bool
"$section" natmode
"-N"
54 append_bool
"$section" autorename
"-r"
55 append_bool
"$section" nochmod
"-R"
56 append_bool
"$section" antiwarez
"-s"
57 append_bool
"$section" allowuserfxp
"-w"
58 append_bool
"$section" allowanonymousfxp
"-W"
59 append_bool
"$section" prohibitdotfileswrite
"-x"
60 append_bool
"$section" prohibitdotfilesread
"-X"
61 append_bool
"$section" allowdotfiles
"-z"
62 append_bool
"$section" customerproof
"-Z"
63 append_bool
"$section" anonymouscantupload
"-i"
64 append_bool
"$section" createhomedir
"-j"
65 append_bool
"$section" keepallfiles
"-K"
66 append_bool
"$section" norename
"-G"
67 append_bool
"$section" dontresolve
"-H"
68 append_bool
"$section" verboselog
"-d"
69 append_bool
"$section" displaydotfiles
"-D"
70 append_bool
"$section" anonymousonly
"-e"
71 append_bool
"$section" brokenclientscompatibility
"-b"
72 append_bool
"$section" notruncate
"-0"
73 append_bool
"$section" logpid
"-1"
74 append_bool
"$section" ipv4only
"-4"
75 append_bool
"$section" ipv6only
"-6"
77 append_string
"$section" bind "-S"
78 append_string
"$section" login
"-l"
80 append_bool
"$section" noanonymous
"-E"
81 append_bool
"$section" chrooteveryone
"-A"
82 append_string
"$section" maxclientsperip
"-c"
83 append_string
"$section" maxclientsnumber
"-C"
84 append_string
"$section" peruserlimits
"-y"
85 append_string
"$section" umask "-U"
87 append_string
"$section" port
"-S"
88 append_string
"$section" authentication
"-l"
90 config_get_bool
"enabled" "$section" "enabled" '1'
91 [ "$enabled" -gt 0 ] && $SSD -S -p $PIDF -q -x $PROG -- -g $PIDF -B $args
95 killall pure-ftpd
2>&1 > /dev
/null
97 # FIXME: Fix Busybox start-stop-daemon to work with multiple PIDs
102 config_load
"pure-ftpd"
103 config_foreach start_service
"pure-ftpd"
107 config_load
"pure-ftpd"
108 config_foreach stop_service
"pure-ftpd"