fix port field, from #7004
[openwrt/svn-archive/archive.git] / multimedia / ftpd-topfield / files / ftpd-topfield.sh
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 START=50
5
6 config_cb() {
7 local cfg="$CONFIG_SECTION"
8 local cfgt
9 config_get cfgt "$cfg" TYPE
10
11 case "$cfgt" in
12 ftpd-topfield)
13 config_get turbo $cfg turbo
14 config_get port $cfg port
15 config_get elpf $cfg elpf
16
17 case "$turbo" in
18 yes|on|enabled|1) turbo=1;;
19 esac
20 case "$elpf" in
21 yes|on|enabled|1) elpf=1;;
22 esac
23 TOPFIELD_ARGS="-D ${turbo:+--turbo }${port:+-P $port }${elpf:+-E}"
24 ;;
25 esac
26 }
27
28 start() {
29 config_load ftpd-topfield
30 /usr/sbin/ftpd-topfield $TOPFIELD_ARGS
31 }
32
33 stop() {
34 killall ftpd-topfield
35 }