1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007-2011 OpenWrt.org
11 config_get_bool _val "$section" "$option" '0'
12 [ "$_val" -gt 0 ] && append args "$3"
20 config_get _val "$section" "$option"
21 [ -n "$_val" ] && append args "$3 $_val"
27 config_get_bool enabled "$section" 'enabled' '0'
28 [ $enabled -gt 0 ] || return 1
30 config_get pid_file "$section" 'pid_file'
33 append_string "$section" 'interface' '-i'
34 append_string "$section" 'pcap_file' '-r'
35 append_string "$section" 'timeout' '-t'
36 append_string "$section" 'max_flows' '-m'
37 append_string "$section" 'host_port' '-n'
38 append_string "$section" 'pid_file' '-p'
39 append_string "$section" 'control_socket' '-c'
40 append_string "$section" 'export_version' '-v'
41 append_string "$section" 'hoplimit' '-L'
42 append_string "$section" 'tracking_level' '-T'
43 append_bool "$section" track_ipv6 '-6'
45 SERVICE_PID_FILE="$pid_file" \
46 service_start /usr/sbin/softflowd $args${pid_file:+ -p $pid_file}
52 config_get_bool enabled "$section" 'enabled' '0'
53 [ $enabled -gt 0 ] || return 1
55 config_get control_socket "$section" 'control_socket'
57 [ -n "control_socket" -a -S $control_socket ] && {
58 /usr/sbin/softflowctl -c $control_socket exit
63 mkdir -m 0755 -p /var/empty
65 config_load 'softflowd'
66 config_foreach start_instance 'softflowd'
70 config_load 'softflowd'
71 config_foreach stop_instance 'softflowd'
72 service_stop /usr/sbin/softflowd