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
24 uci_option_to_json_bool
() {
29 config_get_bool val
"$cfg" $option
30 [ -n "$val" ] && json_add_boolean
$option $val
33 uci_option_to_json_string
() {
38 config_get val
"$cfg" "$option"
39 [ -n "$val" ] && json_add_string
$option "$val"
42 uci_option_to_json
() {
47 config_get val
"$cfg" $option
48 [ -n "$val" ] && json_add_int
$option $val
54 uci_option_to_json_bool
"$cfg" syslog
55 uci_option_to_json_bool
"$cfg" load_kick_enabled
56 uci_option_to_json_string
"$cfg" node_up_script
60 sta_block_timeout local_sta_timeout local_sta_update \
61 max_retry_band seen_policy_timeout \
62 load_balancing_threshold band_steering_threshold \
63 remote_update_interval \
64 min_connect_snr min_snr signal_diff_threshold \
65 initial_connect_delay \
66 roam_kick_delay roam_scan_tries \
67 roam_scan_snr roam_scan_interval \
68 roam_trigger_snr roam_trigger_interval \
69 load_kick_threshold load_kick_delay load_kick_min_clients \
72 uci_option_to_json
"$cfg" "$opt"
78 [ "$ENABLED" -gt 0 ] ||
return
80 ubus
-t 10 wait_for usteer
83 json_add_array interfaces
84 for i
in $
(load_ifaces
); do
85 json_add_string
"" "$i"
90 config_foreach uci_usteer usteer
92 ubus call usteer set_config
"$(json_dump)"
105 procd_add_reload_trigger usteer
106 procd_add_raw_trigger
"interface.*" 2000 /etc
/init.d
/usteer reload
111 local network
="$(uci -q get usteer.@usteer[-1].network)"
112 ENABLED
="$(uci -q get usteer.@usteer[-1].enabled)"
113 ENABLED
="${ENABLED:-1}"
115 [ "$ENABLED" -gt 0 ] ||
return
118 procd_set_param
command "$PROG"