1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007-2011 OpenWrt.org
12 config_get_bool _val
"$section" "$option" '0'
13 [ "$_val" -gt 0 ] && append args
"$3"
21 config_get _val
"$section" "$option"
22 [ -n "$_val" ] && append args
"$3 $_val"
28 config_get_bool enabled
"$section" 'enabled' '0'
29 [ "$enabled" -gt 0 ] ||
return 1
31 config_get pid_file
"$section" 'pid_file'
32 config_get filter
"$section" 'filter'
35 append_string
"$section" 'interface' '-i'
36 append_string
"$section" 'pcap_file' '-r'
37 append_string
"$section" 'timeout' '-t'
38 append_string
"$section" 'max_flows' '-m'
39 append_string
"$section" 'host_port' '-n'
40 append_string
"$section" 'pid_file' '-p'
41 append_string
"$section" 'control_socket' '-c'
42 append_string
"$section" 'export_version' '-v'
43 append_string
"$section" 'hoplimit' '-L'
44 append_string
"$section" 'tracking_level' '-T'
45 append_string
"$section" 'sampling_rate' '-s'
46 append_bool
"$section" track_ipv6
'-6'
49 procd_set_param
command /usr
/sbin
/softflowd
-d $args${pid_file:+ -p $pid_file} "$filter"
50 procd_set_param respawn
58 config_load
'softflowd'
59 config_foreach start_instance
'softflowd'