1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2013 OpenWrt.org
10 .
/lib
/functions
/network.sh
11 .
/usr
/share
/libubox
/jshn.sh
15 local network
="$(uci get usteer.@usteer[-1].network)"
18 json_load
"$(ifstatus $n)"
19 json_get_var device l3_device
25 json_add_string
"" "$1"
28 uci_option_to_json_string_array
() {
32 json_add_array
"$option"
33 config_list_foreach
"$cfg" "$option" _add_string
37 uci_option_to_json_bool
() {
42 config_get_bool val
"$cfg" $option
43 [ -n "$val" ] && json_add_boolean
$option $val
46 uci_option_to_json_string
() {
51 config_get val
"$cfg" "$option"
52 [ -n "$val" ] && json_add_string
$option "$val"
55 uci_option_to_json
() {
60 config_get val
"$cfg" $option
61 [ -n "$val" ] && json_add_int
$option $val
67 uci_option_to_json_bool
"$cfg" syslog
68 uci_option_to_json_bool
"$cfg" ipv6
69 uci_option_to_json_bool
"$cfg" local_mode
70 uci_option_to_json_bool
"$cfg" load_kick_enabled
71 uci_option_to_json_bool
"$cfg" assoc_steering
72 uci_option_to_json_string
"$cfg" node_up_script
73 uci_option_to_json_string_array
"$cfg" ssid_list
74 uci_option_to_json_string_array
"$cfg" event_log_types
78 sta_block_timeout local_sta_timeout local_sta_update \
79 max_neighbor_reports max_retry_band seen_policy_timeout \
80 measurement_report_timeout \
81 load_balancing_threshold band_steering_threshold \
82 remote_update_interval remote_node_timeout\
83 min_connect_snr min_snr min_snr_kick_delay signal_diff_threshold \
84 initial_connect_delay steer_reject_timeout roam_process_timeout\
85 roam_kick_delay roam_scan_tries roam_scan_timeout \
86 roam_scan_snr roam_scan_interval \
87 roam_trigger_snr roam_trigger_interval \
88 load_kick_threshold load_kick_delay load_kick_min_clients \
91 uci_option_to_json
"$cfg" "$opt"
97 [ "$ENABLED" -gt 0 ] ||
return
99 ubus
-t 10 wait_for usteer
102 json_add_array interfaces
103 for i
in $
(load_ifaces
); do
104 json_add_string
"" "$i"
109 config_foreach uci_usteer usteer
111 ubus call usteer set_config
"$(json_dump)"
124 procd_add_reload_trigger usteer
125 procd_add_raw_trigger
"interface.*" 2000 /etc
/init.d
/usteer reload
130 local network
="$(uci -q get usteer.@usteer[-1].network)"
131 ENABLED
="$(uci -q get usteer.@usteer[-1].enabled)"
132 ENABLED
="${ENABLED:-1}"
134 [ "$ENABLED" -gt 0 ] ||
return
137 procd_set_param
command "$PROG"