1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2008 OpenWrt.org
13 config_get_bool _val "$section" "$option" '0'
14 [ "$_val" -gt 0 ] && append args "$3"
22 config_get _val "$section" "$option"
23 [ -n "$_val" ] && append args "$3 $_val"
27 config_get_bool enabled "$1" 'enabled' 0
34 section_enabled "$section" || return 1
37 config_get uid "$section" 'user'
38 config_get servername "$section" 'servername'
39 config_get interface "$section" 'interface'
40 config_get options "$section" 'options'
41 config_get content_directories "$section" 'content_directories'
42 append_bool "$section" 'disable_webif' '-w'
43 append_bool "$section" 'disable_telnet' '-t'
46 service_start /usr/bin/ushare -n "${servername:-OpenWrt}" -i "${interface:-br-lan}" -c "${content_directories:-/tmp}" $args ${options}
52 section_enabled "$section" || return 1
54 config_get uid "$section" "user"
57 service_stop /usr/bin/ushare
62 config_foreach start_instance 'ushare'
67 config_foreach stop_instance 'ushare'