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" load_kick_enabled
69 uci_option_to_json_bool
"$cfg" assoc_steering
70 uci_option_to_json_string
"$cfg" node_up_script
71 uci_option_to_json_string_array
"$cfg" ssid_list
72 uci_option_to_json_string_array
"$cfg" event_log_types
76 sta_block_timeout local_sta_timeout local_sta_update \
77 max_retry_band seen_policy_timeout \
78 load_balancing_threshold band_steering_threshold \
79 remote_update_interval \
80 min_connect_snr min_snr signal_diff_threshold \
81 initial_connect_delay \
82 roam_kick_delay roam_scan_tries \
83 roam_scan_snr roam_scan_interval \
84 roam_trigger_snr roam_trigger_interval \
85 load_kick_threshold load_kick_delay load_kick_min_clients \
88 uci_option_to_json
"$cfg" "$opt"
94 [ "$ENABLED" -gt 0 ] ||
return
96 ubus
-t 10 wait_for usteer
99 json_add_array interfaces
100 for i
in $
(load_ifaces
); do
101 json_add_string
"" "$i"
106 config_foreach uci_usteer usteer
108 ubus call usteer set_config
"$(json_dump)"
121 procd_add_reload_trigger usteer
122 procd_add_raw_trigger
"interface.*" 2000 /etc
/init.d
/usteer reload
127 local network
="$(uci -q get usteer.@usteer[-1].network)"
128 ENABLED
="$(uci -q get usteer.@usteer[-1].enabled)"
129 ENABLED
="${ENABLED:-1}"
131 [ "$ENABLED" -gt 0 ] ||
return
134 procd_set_param
command "$PROG"