1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2009-2012 OpenWrt.org
9 # Needed for restricted TCP port 21
21 local args
="--foreground --error_print=1 $2"
25 config_get_bool enabled
"$config" enabled
0
26 [ "${enabled}" -eq 0 ] && return 1
29 config_get_bool
readonly "$config" readonly 0
30 [ "${readonly}" -eq 1 ] && append args
"--readonly"
33 config_get error_level
"$config" error_level
34 [ -n "${error_level}" ] && append args
"--error_level=${error_level}"
37 config_get options
"$config" options
40 config_list_foreach
"$config" devices append_device
42 config_get SERVICE_UID
"$config" uid
"$DEFAULT_SERVICE_UID"
43 config_get SERVICE_GID
"$config" gid
"$DEFAULT_SERVICE_GID"
45 service_start
"/usr/bin/$program" $args $options $devices
55 config_get port
"$config" port
56 [ -n "${port}" ] && append args
"--port=${port}"
59 config_get max_connections
"$config" max_connections
60 [ -n "${max_connections}" ] && append args
"--max_connections=${max_connections}"
62 start_owfs_daemon
"$config" "$args"
71 service_stop
/usr
/bin
/owftpd