diff --git a/autoinstall/2.x/autoinstall.sh b/autoinstall/2.x/autoinstall.sh index d9a4356..9ee348a 100755 --- a/autoinstall/2.x/autoinstall.sh +++ b/autoinstall/2.x/autoinstall.sh @@ -10,7 +10,7 @@ LUCI_APP=1 HTTPS_DNS_PROXY=1 OWRT_VERSION="current" -RUAB_VERSION="2.1.6-r1" +RUAB_VERSION="2.1.6-r2" RUAB_MOD_LUA_VERSION="2.1.6-r1" RUAB_LUCI_APP_VERSION="2.1.6-r2" BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master" diff --git a/ruantiblock/Makefile b/ruantiblock/Makefile index 416d347..4915bad 100644 --- a/ruantiblock/Makefile +++ b/ruantiblock/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ruantiblock PKG_VERSION:=2.1.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_MAINTAINER:=gSpot include $(INCLUDE_DIR)/package.mk diff --git a/ruantiblock/files/usr/share/ruantiblock/config_script b/ruantiblock/files/usr/share/ruantiblock/config_script index 28fd02d..a956717 100644 --- a/ruantiblock/files/usr/share/ruantiblock/config_script +++ b/ruantiblock/files/usr/share/ruantiblock/config_script @@ -1,5 +1,5 @@ -UCI_SECTION="ruantiblock.config" +UCI_SECTION="${NAME}.config" UCI_VARS="dnsmasq_confdir proxy_mode proxy_local_clients nftset_clear_sets allowed_hosts_mode allowed_hosts_list bypass_mode bypass_entries_dns enable_fproxy fproxy_list enable_bllist_proxy if_vpn vpn_gw_ip vpn_route_check tor_trans_port onion_dns_addr t_proxy_type t_proxy_port_tcp t_proxy_port_udp t_proxy_allow_udp enable_logging bllist_min_entries bllist_module bllist_preset bllist_ip_limit bllist_summarize_ip bllist_summarize_cidr bllist_ip_filter bllist_ip_filter_type bllist_sd_limit bllist_fqdn_filter bllist_fqdn_filter_type bllist_enable_idn bllist_alt_nslookup bllist_alt_dns_addr update_at_startup enable_tmp_downloads" UCI_CMD="$(which uci)" if [ $? -ne 0 ]; then @@ -8,26 +8,30 @@ if [ $? -ne 0 ]; then fi AWK_CMD="awk" -eval $($UCI_CMD show "$UCI_SECTION" | $AWK_CMD -F "=" -v UCI_VARS="$UCI_VARS" ' - BEGIN { - split(UCI_VARS, split_array, " "); - for(i in split_array) - vars_array[split_array[i]]=""; - } - { - sub(/^.*[.]/, "", $1); - gsub(/["\047]/, "", $2); - if($1 in vars_array) { - print toupper($1) "=\"" $2 "\""; - delete vars_array[$1]; - }; - } - END { - if(length(vars_array) > 0) { - for(i in vars_array) - print toupper(i) "=\"""\""; - }; - }') +eval $($UCI_CMD show "$UCI_SECTION" | $AWK_CMD -v UCI_VARS="$UCI_VARS" ' + BEGIN { + split(UCI_VARS, split_array, " "); + for(i in split_array) + vars_array[split_array[i]]=""; + } + { + match($0, /^[^=]+/); + end = RSTART + RLENGTH; + name = substr($0, RSTART, end - 1); + val = substr($0, end + 1); + sub(/^.*[.]/, "", name); + gsub(/["\047]/, "", val); + if(name in vars_array) { + print toupper(name) "=\"" val "\""; + delete vars_array[name]; + }; + } + END { + if(length(vars_array) > 0) { + for(i in vars_array) + print toupper(i) "=\"""\""; + }; + }') . /lib/functions/network.sh network_get_subnet subnet_lan "lan" diff --git a/ruantiblock/files/usr/share/ruantiblock/config_script_user_instances b/ruantiblock/files/usr/share/ruantiblock/config_script_user_instances index 02e5d47..7422192 100644 --- a/ruantiblock/files/usr/share/ruantiblock/config_script_user_instances +++ b/ruantiblock/files/usr/share/ruantiblock/config_script_user_instances @@ -27,26 +27,30 @@ IncludeUserInstanceVars() { local _inst="$1" local _uci_section="${NAME}.${_inst}" U_NAME="$_inst" - eval $($UCI_CMD show "$_uci_section" | $AWK_CMD -F "=" -v UCI_VARS="$UCI_VARS" ' - BEGIN { - split(UCI_VARS, split_array, " "); - for(i in split_array) - vars_array[split_array[i]]=""; - } - { - sub(/^.*[.]/, "", $1); - gsub(/["\047]/, "", $2); - if($1 in vars_array) { - print toupper($1) "=\"" $2 "\""; - delete vars_array[$1]; - }; - } - END { - if(length(vars_array) > 0) { - for(i in vars_array) - print toupper(i) "=\"""\""; - }; - }') + eval $($UCI_CMD show "$_uci_section" | $AWK_CMD -v UCI_VARS="$UCI_VARS" ' + BEGIN { + split(UCI_VARS, split_array, " "); + for(i in split_array) + vars_array[split_array[i]]=""; + } + { + match($0, /^[^=]+/); + end = RSTART + RLENGTH; + name = substr($0, RSTART, end - 1); + val = substr($0, end + 1); + sub(/^.*[.]/, "", name); + gsub(/["\047]/, "", val); + if(name in vars_array) { + print toupper(name) "=\"" val "\""; + delete vars_array[name]; + }; + } + END { + if(length(vars_array) > 0) { + for(i in vars_array) + print toupper(i) "=\"""\""; + }; + }') if [ $DEBUG -ge 2 ]; then echo " user_instances_config_script.IncludeUserInstanceVars: _inst=${_inst} U_NAME=${U_NAME} U_PROXY_MODE=${U_PROXY_MODE}" >&2