2023-12-04 00:20:42 Auto Sync
This commit is contained in:
parent
9a69830f0f
commit
d7cc56837f
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.45.152
|
||||
PKG_RELEASE:=245
|
||||
PKG_VERSION:=0.45.157
|
||||
PKG_RELEASE:=246
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
@ -41,58 +41,85 @@ end
|
||||
|
||||
local e,a={}
|
||||
for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
|
||||
a=fs.stat(o)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=fs.basename(o)
|
||||
BACKUP_FILE="/etc/openclash/backup/".. e[t].name
|
||||
if fs.mtime(BACKUP_FILE) then
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE))
|
||||
else
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
|
||||
end
|
||||
if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then
|
||||
e[t].state=translate("Enable")
|
||||
else
|
||||
e[t].state=translate("Disable")
|
||||
end
|
||||
e[t].check=translate(config_check(o))
|
||||
end
|
||||
a=fs.stat(o)
|
||||
if a then
|
||||
e[t]={}
|
||||
e[t].num=string.format(t)
|
||||
e[t].name=fs.basename(o)
|
||||
BACKUP_FILE="/etc/openclash/backup/".. e[t].name
|
||||
if fs.mtime(BACKUP_FILE) then
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE))
|
||||
else
|
||||
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
|
||||
end
|
||||
if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then
|
||||
e[t].state=translate("Enable")
|
||||
else
|
||||
e[t].state=translate("Disable")
|
||||
end
|
||||
e[t].check=translate(config_check(o))
|
||||
end
|
||||
end
|
||||
|
||||
form = SimpleForm("openclash")
|
||||
form.reset = false
|
||||
form.submit = false
|
||||
tb=form:section(Table,e)
|
||||
st=tb:option(DummyValue,"state",translate("State"))
|
||||
nm=tb:option(DummyValue,"name",translate("Config Alias"))
|
||||
sb=tb:option(DummyValue,"name",translate("Subscription Info"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
ck=tb:option(DummyValue,"check",translate("Grammar Check"))
|
||||
st.template="openclash/cfg_check"
|
||||
ck.template="openclash/cfg_check"
|
||||
sb.template="openclash/sub_info_show"
|
||||
if a then
|
||||
tb=form:section(Table,e)
|
||||
st=tb:option(DummyValue,"state",translate("State"))
|
||||
nm=tb:option(DummyValue,"name",translate("Config Alias"))
|
||||
sb=tb:option(DummyValue,"name",translate("Subscription Info"))
|
||||
mt=tb:option(DummyValue,"mtime",translate("Update Time"))
|
||||
ck=tb:option(DummyValue,"check",translate("Grammar Check"))
|
||||
st.template="openclash/cfg_check"
|
||||
ck.template="openclash/cfg_check"
|
||||
sb.template="openclash/sub_info_show"
|
||||
|
||||
btnis=tb:option(Button,"switch",translate("Switch Config"))
|
||||
btnis.template="openclash/other_button"
|
||||
btnis.render=function(o,t,a)
|
||||
if not e[t] then return false end
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
btnis=tb:option(Button,"switch",translate("Switch Config"))
|
||||
btnis.template="openclash/other_button"
|
||||
btnis.render=function(o,t,a)
|
||||
if not e[t] then return false end
|
||||
if IsYamlFile(e[t].name) or IsYmlFile(e[t].name) then
|
||||
a.display=""
|
||||
else
|
||||
a.display="none"
|
||||
end
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btnis.write=function(a,t)
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "client"))
|
||||
end
|
||||
end
|
||||
o.inputstyle="apply"
|
||||
Button.render(o,t,a)
|
||||
end
|
||||
btnis.write=function(a,t)
|
||||
fs.unlink("/tmp/Proxy_Group")
|
||||
uci:set("openclash", "config", "config_path", "/etc/openclash/config/"..e[t].name)
|
||||
uci:set("openclash", "config", "enable", 1)
|
||||
uci:commit("openclash")
|
||||
SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &")
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "client"))
|
||||
|
||||
if not a then
|
||||
local tc = {
|
||||
{create, upload}
|
||||
}
|
||||
tb=form:section(Table,tc)
|
||||
btncr=tb:option(Button,"create",translate("Config Subscribe"))
|
||||
btncr.template="openclash/other_button"
|
||||
btncr.inputstyle="apply"
|
||||
btncr.write=function()
|
||||
local sid = uci:add("openclash", "config_subscribe")
|
||||
if sid then
|
||||
uci:commit("openclash")
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config-subscribe-edit", sid))
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
btnup=tb:option(Button,"upload",translate("Upload Config File"))
|
||||
btnup.template="openclash/other_button"
|
||||
btnup.inputstyle="apply"
|
||||
btnup.write=function()
|
||||
HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "config"))
|
||||
end
|
||||
end
|
||||
|
||||
s = SimpleForm("openclash")
|
||||
|
@ -102,7 +102,6 @@ o.rmempty = true
|
||||
o.description = font_red..bold_on..translate("Note: There is A Risk of Privacy Leakage in Online Convert")..bold_off..font_off
|
||||
o:depends("sub_convert", "1")
|
||||
o:value("https://api.dler.io/sub", translate("api.dler.io")..translate("(Default)"))
|
||||
o:value("https://subconverter.herokuapp.com/sub", translate("subconverter.herokuapp.com")..translate("(Default)"))
|
||||
o:value("https://v.id9.cc/sub", translate("v.id9.cc")..translate("(Support Vless By Pinyun)"))
|
||||
o:value("https://sub.id9.cc/sub", translate("sub.id9.cc"))
|
||||
o:value("https://api.wcc.best/sub", translate("api.wcc.best"))
|
||||
|
@ -747,7 +747,7 @@ o:depends("type", "tuic")
|
||||
-- [[ TFO ]]--
|
||||
o = s:option(ListValue, "tfo", translate("TFO")..translate("(Only Meta Core)"))
|
||||
o.rmempty = true
|
||||
o.default = "true"
|
||||
o.default = "false"
|
||||
o:value("true")
|
||||
o:value("false")
|
||||
o:depends("type", "http")
|
||||
@ -800,7 +800,7 @@ o:value("ipv4")
|
||||
o:value("ipv4-prefer")
|
||||
o:value("ipv6")
|
||||
o:value("ipv6-prefer")
|
||||
o.default = "dual"
|
||||
o.default = "ipv4-prefer"
|
||||
|
||||
-- [[ smux ]]--
|
||||
o = s:option(ListValue, "multiplex", translate("Multiplex")..translate("(Only Meta Core)"))
|
||||
|
@ -830,11 +830,11 @@
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Metacubexd Control Panel%>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
url9='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/metacubexd/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
url9='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/metacubexd/#/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port) {
|
||||
var ui_proto = status.db_forward_ssl == 0 ? 'http://' : 'https://';
|
||||
url9='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/metacubexd/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
url9='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/metacubexd/#/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else {
|
||||
url9='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/metacubexd/"%>';
|
||||
@ -850,11 +850,11 @@
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Yacd Control Panel%>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/#/?hostname='+ window.location.hostname + '&port=' + status.cn_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port) {
|
||||
var ui_proto = status.db_forward_ssl == 0 ? 'http://' : 'https://';
|
||||
url1='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/yacd/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
url1='<%="'+ui_proto+status.db_foward_domain+':'+status.db_foward_port+'/ui/yacd/#/?hostname='+ status.db_foward_domain + '&port=' + status.db_foward_port + '&secret=' + status.dase +'"%>';
|
||||
}
|
||||
else {
|
||||
url1='<%="http://'+window.location.hostname+':'+status.cn_port+'/ui/yacd/"%>';
|
||||
|
@ -302,6 +302,9 @@ msgstr "规则设置"
|
||||
msgid "Config Manage"
|
||||
msgstr "配置管理"
|
||||
|
||||
msgid "Upload Config File"
|
||||
msgstr "上传配置文件"
|
||||
|
||||
msgid "Upload File Type"
|
||||
msgstr "上传文件类型"
|
||||
|
||||
|
@ -3274,8 +3274,8 @@ reload()
|
||||
revert_firewall 2>/dev/null
|
||||
do_run_mode 2>/dev/null
|
||||
get_config 2>/dev/null
|
||||
start_run_core
|
||||
check_core_status
|
||||
#start_run_core
|
||||
#check_core_status
|
||||
set_firewall 2>/dev/null
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
SLOG_CLEAN
|
||||
|
@ -19,6 +19,7 @@ mkdir -p /etc/openclash/core
|
||||
mkdir -p /etc/openclash/history
|
||||
mkdir -p /usr/share/openclash/backup
|
||||
|
||||
#Backup
|
||||
cp -f "/etc/config/openclash" "/usr/share/openclash/backup/openclash" >/dev/null 2>&1
|
||||
cp -f "/etc/openclash/custom/openclash_custom_rules.list" "/usr/share/openclash/backup/openclash_custom_rules.list" >/dev/null 2>&1
|
||||
cp -f "/etc/openclash/custom/openclash_custom_rules_2.list" "/usr/share/openclash/backup/openclash_custom_rules_2.list" >/dev/null 2>&1
|
||||
@ -43,37 +44,17 @@ cat > "/lib/upgrade/keep.d/luci-app-openclash" <<-EOF
|
||||
/etc/openclash/
|
||||
EOF
|
||||
|
||||
if [ -f "/tmp/openclash.bak" ]; then
|
||||
mv -f "/tmp/openclash.bak" "/etc/config/openclash" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash/." "/etc/openclash/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_config/." "/etc/openclash/config/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_core/." "/etc/openclash/core/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_history/." "/etc/openclash/history/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_proxy_provider/." "/etc/openclash/proxy_provider/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_rule_provider/." "/etc/openclash/rule_provider/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_game_rules/." "/etc/openclash/game_rules/" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_rules.list.bak" "/etc/openclash/custom/openclash_custom_rules.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_rules_2.list.bak" "/etc/openclash/custom/openclash_custom_rules_2.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_hosts.list.bak" "/etc/openclash/custom/openclash_custom_hosts.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_fake_filter.list.bak" "/etc/openclash/custom/openclash_custom_fake_filter.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_domain_dns.list.bak" "/etc/openclash/custom/openclash_custom_domain_dns.list" >/dev/null 2>&1
|
||||
if [ -d "/tmp/openclash_dashboard/" ]; then
|
||||
rm -rf "/usr/share/openclash/ui/dashboard/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_dashboard/." "/usr/share/openclash/ui/dashboard/" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash_dashboard/" >/dev/null 2>&1
|
||||
fi
|
||||
if [ -d "/tmp/openclash_yacd/" ]; then
|
||||
rm -rf "/usr/share/openclash/ui/yacd/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_yacd/." "/usr/share/openclash/ui/yacd/" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash_yacd/" >/dev/null 2>&1
|
||||
fi
|
||||
rm -rf "/etc/openclash/openclash" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/fake_filter.list" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/openclash_servers_fake_filter.conf" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash.bak" >/dev/null 2>&1
|
||||
fi
|
||||
#Set Dashboard Secret
|
||||
uci -q set openclash.config.dashboard_password="$(tr -cd 'a-zA-Z0-9' </dev/urandom 2>/dev/null| head -c8 || date +%N| md5sum |head -c8)"
|
||||
|
||||
#Set authentication
|
||||
uci_name_tmp=$(uci add openclash authentication)
|
||||
uci_set="uci -q set openclash.$uci_name_tmp."
|
||||
${uci_set}enabled="1"
|
||||
${uci_set}username="Clash"
|
||||
${uci_set}password="$(tr -cd 'a-zA-Z0-9' </dev/urandom 2>/dev/null| head -c8 || date +%N| md5sum |head -c8)"
|
||||
|
||||
#Set Core Model
|
||||
source "/etc/openwrt_release"
|
||||
case "${DISTRIB_ARCH}" in
|
||||
aarch64_*)
|
||||
@ -109,10 +90,48 @@ case "${DISTRIB_ARCH}" in
|
||||
esac
|
||||
uci -q set openclash.config.core_version="${CORE_ARCH}"
|
||||
|
||||
#Backup Resolvfile
|
||||
if [ -n "$(uci -q get dhcp.@dnsmasq[0].resolvfile)" ]; then
|
||||
uci -q set openclash.config.default_resolvfile=$(uci -q get dhcp.@dnsmasq[0].resolvfile)
|
||||
fi
|
||||
|
||||
uci -q commit openclash
|
||||
|
||||
#Restore
|
||||
if [ -f "/tmp/openclash.bak" ]; then
|
||||
mv -f "/tmp/openclash.bak" "/etc/config/openclash" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash/." "/etc/openclash/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_config/." "/etc/openclash/config/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_core/." "/etc/openclash/core/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_history/." "/etc/openclash/history/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_proxy_provider/." "/etc/openclash/proxy_provider/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_rule_provider/." "/etc/openclash/rule_provider/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_game_rules/." "/etc/openclash/game_rules/" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_rules.list.bak" "/etc/openclash/custom/openclash_custom_rules.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_rules_2.list.bak" "/etc/openclash/custom/openclash_custom_rules_2.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_hosts.list.bak" "/etc/openclash/custom/openclash_custom_hosts.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_fake_filter.list.bak" "/etc/openclash/custom/openclash_custom_fake_filter.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_domain_dns.list.bak" "/etc/openclash/custom/openclash_custom_domain_dns.list" >/dev/null 2>&1
|
||||
if [ -d "/tmp/openclash_dashboard/" ]; then
|
||||
rm -rf "/usr/share/openclash/ui/dashboard/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_dashboard/." "/usr/share/openclash/ui/dashboard/" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash_dashboard/" >/dev/null 2>&1
|
||||
fi
|
||||
if [ -d "/tmp/openclash_yacd/" ]; then
|
||||
rm -rf "/usr/share/openclash/ui/yacd/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_yacd/." "/usr/share/openclash/ui/yacd/" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash_yacd/" >/dev/null 2>&1
|
||||
fi
|
||||
rm -rf "/etc/openclash/openclash" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/fake_filter.list" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/openclash_servers_fake_filter.conf" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash.bak" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
uci -q set openclash.config.enable=0
|
||||
uci -q commit openclash
|
||||
|
||||
if [ -f "/usr/lib/lua/luci/model/network.lua" ]; then
|
||||
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
|
||||
cat >> "/usr/lib/lua/luci/model/network.lua" << EOF
|
||||
@ -167,24 +186,6 @@ end
|
||||
EOF
|
||||
fi
|
||||
|
||||
#Set authentication
|
||||
if [ -n "$(uci -q get openclash.@authentication[0].enabled)" ]; then
|
||||
auth_cfg=false
|
||||
else
|
||||
auth_cfg=true
|
||||
fi
|
||||
|
||||
if $auth_cfg; then
|
||||
uci_name_tmp=$(uci add openclash authentication)
|
||||
uci_set="uci -q set openclash.$uci_name_tmp."
|
||||
${uci_set}enabled="1"
|
||||
${uci_set}username="Clash"
|
||||
${uci_set}password="$(tr -cd 'a-zA-Z0-9' </dev/urandom 2>/dev/null| head -c8 || date +%N| md5sum |head -c8)"
|
||||
fi
|
||||
|
||||
uci -q set openclash.config.enable=0
|
||||
uci -q commit openclash
|
||||
|
||||
#set uhttpd && HTTP_MAX_CONTENT for large file edit
|
||||
uci -q set uhttpd.main.max_requests=50
|
||||
uci -q set uhttpd.main.max_connections=100
|
||||
|
@ -89,15 +89,12 @@ config_download()
|
||||
{
|
||||
if [ -n "$subscribe_url_param" ]; then
|
||||
if [ -n "$c_address" ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: ${sub_ua}' "$c_address""$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" "$c_address""$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: ${sub_ua}' https://api.dler.io/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: ${sub_ua}' https://subconverter.herokuapp.com/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" https://api.dler.io/sub"$subscribe_url_param" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
else
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H 'User-Agent: ${sub_ua}' "$subscribe_url" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 -H "$sub_ua" "$subscribe_url" -o "$CFG_FILE" 2>&1 | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$CFG_FILE" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -579,6 +576,10 @@ sub_info_get()
|
||||
udp=""
|
||||
fi
|
||||
|
||||
if [ -n "$sub_ua" ]; then
|
||||
sub_ua="User-Agent: $sub_ua"
|
||||
fi
|
||||
|
||||
if [ "$rule_provider" == "true" ]; then
|
||||
rule_provider="&expand=false&classic=true"
|
||||
else
|
||||
@ -628,8 +629,8 @@ sub_info_get()
|
||||
fi
|
||||
if [ -n "$template_path" ]; then
|
||||
template_path_encode=$(urlencode "$template_path")
|
||||
[ -n "$key_match_param" ] && key_match_param="(?i)$(urlencode "$key_match_param")"
|
||||
[ -n "$key_ex_match_param" ] && key_ex_match_param="(?i)$(urlencode "$key_ex_match_param")"
|
||||
[ -n "$key_match_param" ] && key_match_param="$(urlencode "$key_match_param")"
|
||||
[ -n "$key_ex_match_param" ] && key_ex_match_param="$(urlencode "$key_ex_match_param")"
|
||||
subscribe_url_param="?target=clash&new_name=true&url=$subscribe_url&config=$template_path_encode&include=$key_match_param&exclude=$key_ex_match_param&emoji=$emoji&list=false&sort=$sort$udp&scv=$skip_cert_verify&append_type=$node_type&fdn=true$rule_provider"
|
||||
c_address="$convert_address"
|
||||
else
|
||||
|
@ -185,7 +185,7 @@ do
|
||||
Thread.new{
|
||||
#strategy
|
||||
if Value['proxy-groups'][$count].key?('strategy') then
|
||||
group_strategy = '${uci_set}strategy=' + Value['proxy-groups'][$count]['strategy'].to_s
|
||||
group_strategy = '${uci_set}strategy=\"' + Value['proxy-groups'][$count]['strategy'].to_s + '\"'
|
||||
system(group_strategy)
|
||||
end;
|
||||
}.join;
|
||||
@ -193,7 +193,7 @@ do
|
||||
Thread.new{
|
||||
#disable-udp
|
||||
if Value['proxy-groups'][$count].key?('disable-udp') then
|
||||
group_disable_udp = '${uci_set}disable_udp=' + Value['proxy-groups'][$count]['disable-udp'].to_s
|
||||
group_disable_udp = '${uci_set}disable_udp=\"' + Value['proxy-groups'][$count]['disable-udp'].to_s + '\"'
|
||||
system(group_disable_udp)
|
||||
end;
|
||||
}.join;
|
||||
@ -208,14 +208,14 @@ do
|
||||
|
||||
#test_interval
|
||||
if Value['proxy-groups'][$count].key?('interval') then
|
||||
group_test_interval = '${uci_set}test_interval=' + Value['proxy-groups'][$count]['interval'].to_s
|
||||
group_test_interval = '${uci_set}test_interval=\"' + Value['proxy-groups'][$count]['interval'].to_s + '\"'
|
||||
system(group_test_interval)
|
||||
end;
|
||||
|
||||
#test_tolerance
|
||||
if Value['proxy-groups'][$count]['type'] == 'url-test' then
|
||||
if Value['proxy-groups'][$count].key?('tolerance') then
|
||||
group_test_tolerance = '${uci_set}tolerance=' + Value['proxy-groups'][$count]['tolerance'].to_s
|
||||
group_test_tolerance = '${uci_set}tolerance=\"' + Value['proxy-groups'][$count]['tolerance'].to_s + '\"'
|
||||
system(group_test_tolerance)
|
||||
end;
|
||||
end;
|
||||
@ -225,7 +225,7 @@ do
|
||||
Thread.new{
|
||||
#Policy Filter
|
||||
if Value['proxy-groups'][$count].key?('filter') then
|
||||
policy_filter = '${uci_set}policy_filter=' + Value['proxy-groups'][$count]['filter'].to_s
|
||||
policy_filter = '${uci_set}policy_filter=\"' + Value['proxy-groups'][$count]['filter'].to_s + '\"'
|
||||
system(policy_filter)
|
||||
end
|
||||
}.join;
|
||||
@ -233,7 +233,7 @@ do
|
||||
Thread.new{
|
||||
#interface-name
|
||||
if Value['proxy-groups'][$count].key?('interface-name') then
|
||||
interface_name = '${uci_set}interface_name=' + Value['proxy-groups'][$count]['interface-name'].to_s
|
||||
interface_name = '${uci_set}interface_name=\"' + Value['proxy-groups'][$count]['interface-name'].to_s + '\"'
|
||||
system(interface_name)
|
||||
end
|
||||
}.join;
|
||||
@ -241,7 +241,7 @@ do
|
||||
Thread.new{
|
||||
#routing-mark
|
||||
if Value['proxy-groups'][$count].key?('routing-mark') then
|
||||
routing_mark = '${uci_set}routing_mark=' + Value['proxy-groups'][$count]['routing-mark'].to_s
|
||||
routing_mark = '${uci_set}routing_mark=\"' + Value['proxy-groups'][$count]['routing-mark'].to_s + '\"'
|
||||
system(routing_mark)
|
||||
end
|
||||
}.join;
|
||||
|
@ -242,7 +242,7 @@ do
|
||||
Thread.new{
|
||||
#gen_interval
|
||||
if Value['proxy-providers'].values[$provider_count].key?('interval') then
|
||||
provider_gen_interval = '${uci_set}provider_interval=' + Value['proxy-providers'].values[$provider_count]['interval'].to_s
|
||||
provider_gen_interval = '${uci_set}provider_interval=\"' + Value['proxy-providers'].values[$provider_count]['interval'].to_s + '\"'
|
||||
system(provider_gen_interval)
|
||||
end
|
||||
}.join;
|
||||
@ -250,7 +250,7 @@ do
|
||||
Thread.new{
|
||||
#filter
|
||||
if Value['proxy-providers'].values[$provider_count].key?('filter') then
|
||||
provider_gen_filter = '${uci_set}provider_filter=' + Value['proxy-providers'].values[$provider_count]['filter'].to_s
|
||||
provider_gen_filter = '${uci_set}provider_filter=\"' + Value['proxy-providers'].values[$provider_count]['filter'].to_s + '\"'
|
||||
system(provider_gen_filter)
|
||||
end
|
||||
}.join;
|
||||
@ -259,7 +259,7 @@ do
|
||||
#che_enable
|
||||
if Value['proxy-providers'].values[$provider_count].key?('health-check') then
|
||||
if Value['proxy-providers'].values[$provider_count]['health-check'].key?('enable') then
|
||||
provider_che_enable = '${uci_set}health_check=' + Value['proxy-providers'].values[$provider_count]['health-check']['enable'].to_s
|
||||
provider_che_enable = '${uci_set}health_check=\"' + Value['proxy-providers'].values[$provider_count]['health-check']['enable'].to_s + '\"'
|
||||
system(provider_che_enable)
|
||||
end
|
||||
end
|
||||
@ -279,7 +279,7 @@ do
|
||||
#che_interval
|
||||
if Value['proxy-providers'].values[$provider_count].key?('health-check') then
|
||||
if Value['proxy-providers'].values[$provider_count]['health-check'].key?('interval') then
|
||||
provider_che_interval = '${uci_set}health_check_interval=' + Value['proxy-providers'].values[$provider_count]['health-check']['interval'].to_s
|
||||
provider_che_interval = '${uci_set}health_check_interval=\"' + Value['proxy-providers'].values[$provider_count]['health-check']['interval'].to_s + '\"'
|
||||
system(provider_che_interval)
|
||||
end
|
||||
end
|
||||
@ -429,7 +429,7 @@ do
|
||||
Thread.new{
|
||||
#port
|
||||
if Value['proxies'][$count].key?('port') then
|
||||
port = '${uci_set}port=' + Value['proxies'][$count]['port'].to_s
|
||||
port = '${uci_set}port=\"' + Value['proxies'][$count]['port'].to_s + '\"'
|
||||
system(port)
|
||||
end
|
||||
}.join;
|
||||
@ -437,7 +437,7 @@ do
|
||||
Thread.new{
|
||||
#udp
|
||||
if Value['proxies'][$count].key?('udp') then
|
||||
udp = '${uci_set}udp=' + Value['proxies'][$count]['udp'].to_s
|
||||
udp = '${uci_set}udp=\"' + Value['proxies'][$count]['udp'].to_s + '\"'
|
||||
system(udp)
|
||||
end
|
||||
}.join;
|
||||
@ -445,7 +445,7 @@ do
|
||||
Thread.new{
|
||||
#interface-name
|
||||
if Value['proxies'][$count].key?('interface-name') then
|
||||
interface_name = '${uci_set}interface_name=' + Value['proxies'][$count]['interface-name'].to_s
|
||||
interface_name = '${uci_set}interface_name=\"' + Value['proxies'][$count]['interface-name'].to_s + '\"'
|
||||
system(interface_name)
|
||||
end
|
||||
}.join;
|
||||
@ -453,7 +453,7 @@ do
|
||||
Thread.new{
|
||||
#routing-mark
|
||||
if Value['proxies'][$count].key?('routing-mark') then
|
||||
routing_mark = '${uci_set}routing_mark=' + Value['proxies'][$count]['routing-mark'].to_s
|
||||
routing_mark = '${uci_set}routing_mark=\"' + Value['proxies'][$count]['routing-mark'].to_s + '\"'
|
||||
system(routing_mark)
|
||||
end
|
||||
}.join;
|
||||
@ -461,7 +461,7 @@ do
|
||||
Thread.new{
|
||||
#ip_version
|
||||
if Value['proxies'][$count].key?('ip-version') then
|
||||
ip_version = '${uci_set}ip_version=' + Value['proxies'][$count]['ip-version'].to_s
|
||||
ip_version = '${uci_set}ip_version=\"' + Value['proxies'][$count]['ip-version'].to_s + '\"'
|
||||
system(ip_version)
|
||||
end
|
||||
}.join
|
||||
@ -469,7 +469,7 @@ do
|
||||
Thread.new{
|
||||
#TFO
|
||||
if Value['proxies'][$count].key?('tfo') then
|
||||
tfo = '${uci_set}tfo=' + Value['proxies'][$count]['tfo'].to_s
|
||||
tfo = '${uci_set}tfo=\"' + Value['proxies'][$count]['tfo'].to_s + '\"'
|
||||
system(tfo)
|
||||
end
|
||||
}.join
|
||||
@ -478,42 +478,42 @@ do
|
||||
#Multiplex
|
||||
if Value['proxies'][$count].key?('smux') then
|
||||
if Value['proxies'][$count]['smux'].key?('enabled') then
|
||||
smux = '${uci_set}multiplex=' + Value['proxies'][$count]['smux']['enabled'].to_s
|
||||
smux = '${uci_set}multiplex=\"' + Value['proxies'][$count]['smux']['enabled'].to_s + '\"'
|
||||
system(smux)
|
||||
end;
|
||||
#multiplex_protocol
|
||||
if Value['proxies'][$count]['smux'].key?('protocol') then
|
||||
multiplex_protocol = '${uci_set}multiplex_protocol=' + Value['proxies'][$count]['smux']['protocol'].to_s
|
||||
multiplex_protocol = '${uci_set}multiplex_protocol=\"' + Value['proxies'][$count]['smux']['protocol'].to_s + '\"'
|
||||
system(multiplex_protocol)
|
||||
end;
|
||||
#multiplex_max_connections
|
||||
if Value['proxies'][$count]['smux'].key?('max-connections') then
|
||||
multiplex_max_connections = '${uci_set}multiplex_max_connections=' + Value['proxies'][$count]['smux']['max-connections'].to_s
|
||||
multiplex_max_connections = '${uci_set}multiplex_max_connections=\"' + Value['proxies'][$count]['smux']['max-connections'].to_s + '\"'
|
||||
system(multiplex_max_connections)
|
||||
end;
|
||||
#multiplex_min_streams
|
||||
if Value['proxies'][$count]['smux'].key?('min-streams') then
|
||||
multiplex_min_streams = '${uci_set}multiplex_min_streams=' + Value['proxies'][$count]['smux']['min-streams'].to_s
|
||||
multiplex_min_streams = '${uci_set}multiplex_min_streams=\"' + Value['proxies'][$count]['smux']['min-streams'].to_s + '\"'
|
||||
system(multiplex_min_streams)
|
||||
end;
|
||||
#multiplex_max_streams
|
||||
if Value['proxies'][$count]['smux'].key?('max-streams') then
|
||||
multiplex_max_streams = '${uci_set}multiplex_max_streams=' + Value['proxies'][$count]['smux']['max-streams'].to_s
|
||||
multiplex_max_streams = '${uci_set}multiplex_max_streams=\"' + Value['proxies'][$count]['smux']['max-streams'].to_s + '\"'
|
||||
system(multiplex_max_streams)
|
||||
end;
|
||||
#multiplex_padding
|
||||
if Value['proxies'][$count]['smux'].key?('padding') then
|
||||
multiplex_padding = '${uci_set}multiplex_padding=' + Value['proxies'][$count]['smux']['padding'].to_s
|
||||
multiplex_padding = '${uci_set}multiplex_padding=\"' + Value['proxies'][$count]['smux']['padding'].to_s + '\"'
|
||||
system(multiplex_padding)
|
||||
end;
|
||||
#multiplex_statistic
|
||||
if Value['proxies'][$count]['smux'].key?('statistic') then
|
||||
multiplex_statistic = '${uci_set}multiplex_statistic=' + Value['proxies'][$count]['smux']['statistic'].to_s
|
||||
multiplex_statistic = '${uci_set}multiplex_statistic=\"' + Value['proxies'][$count]['smux']['statistic'].to_s + '\"'
|
||||
system(multiplex_statistic)
|
||||
end;
|
||||
#multiplex_only_tcp
|
||||
if Value['proxies'][$count]['smux'].key?('only-tcp') then
|
||||
multiplex_only_tcp = '${uci_set}multiplex_only_tcp=' + Value['proxies'][$count]['smux']['only-tcp'].to_s
|
||||
multiplex_only_tcp = '${uci_set}multiplex_only_tcp=\"' + Value['proxies'][$count]['smux']['only-tcp'].to_s + '\"'
|
||||
system(multiplex_only_tcp)
|
||||
end;
|
||||
end;
|
||||
@ -523,7 +523,7 @@ do
|
||||
Thread.new{
|
||||
#cipher
|
||||
if Value['proxies'][$count].key?('cipher') then
|
||||
cipher = '${uci_set}cipher=' + Value['proxies'][$count]['cipher'].to_s
|
||||
cipher = '${uci_set}cipher=\"' + Value['proxies'][$count]['cipher'].to_s + '\"'
|
||||
system(cipher)
|
||||
end
|
||||
}.join
|
||||
@ -531,7 +531,7 @@ do
|
||||
Thread.new{
|
||||
#udp-over-tcp
|
||||
if Value['proxies'][$count].key?('udp-over-tcp') then
|
||||
udp_over_tcp = '${uci_set}udp_over_tcp=' + Value['proxies'][$count]['udp-over-tcp'].to_s
|
||||
udp_over_tcp = '${uci_set}udp_over_tcp=\"' + Value['proxies'][$count]['udp-over-tcp'].to_s + '\"'
|
||||
system(udp_over_tcp)
|
||||
end
|
||||
}.join
|
||||
@ -541,7 +541,7 @@ do
|
||||
if Value['proxies'][$count].key?('plugin-opts') then
|
||||
#mode
|
||||
if Value['proxies'][$count]['plugin-opts'].key?('mode') then
|
||||
mode = '${uci_set}obfs=' + Value['proxies'][$count]['plugin-opts']['mode'].to_s
|
||||
mode = '${uci_set}obfs=\"' + Value['proxies'][$count]['plugin-opts']['mode'].to_s + '\"'
|
||||
system(mode)
|
||||
else
|
||||
mode = '${uci_set}obfs=none'
|
||||
@ -554,7 +554,7 @@ do
|
||||
end
|
||||
#fingerprint
|
||||
if Value['proxies'][$count]['plugin-opts'].key?('fingerprint') then
|
||||
fingerprint = '${uci_set}fingerprint=' + Value['proxies'][$count]['plugin-opts']['fingerprint'].to_s
|
||||
fingerprint = '${uci_set}fingerprint=\"' + Value['proxies'][$count]['plugin-opts']['fingerprint'].to_s + '\"'
|
||||
system(fingerprint)
|
||||
end
|
||||
if Value['proxies'][$count]['plugin'].to_s == 'v2ray-plugin' then
|
||||
@ -565,7 +565,7 @@ do
|
||||
end
|
||||
#mux
|
||||
if Value['proxies'][$count]['plugin-opts'].key?('mux') then
|
||||
mux = '${uci_set}mux=' + Value['proxies'][$count]['plugin-opts']['mux'].to_s
|
||||
mux = '${uci_set}mux=\"' + Value['proxies'][$count]['plugin-opts']['mux'].to_s + '\"'
|
||||
system(mux)
|
||||
end
|
||||
#headers
|
||||
@ -577,17 +577,17 @@ do
|
||||
end
|
||||
#tls
|
||||
if Value['proxies'][$count]['plugin-opts'].key?('tls') then
|
||||
tls = '${uci_set}tls=' + Value['proxies'][$count]['plugin-opts']['tls'].to_s
|
||||
tls = '${uci_set}tls=\"' + Value['proxies'][$count]['plugin-opts']['tls'].to_s + '\"'
|
||||
system(tls)
|
||||
end
|
||||
#skip-cert-verify
|
||||
if Value['proxies'][$count]['plugin-opts'].key?('skip-cert-verify') then
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=' + Value['proxies'][$count]['plugin-opts']['skip-cert-verify'].to_s
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=\"' + Value['proxies'][$count]['plugin-opts']['skip-cert-verify'].to_s + '\"'
|
||||
system(skip_cert_verify)
|
||||
end
|
||||
end;
|
||||
if Value['proxies'][$count]['plugin'].to_s == 'shadow-tls' then
|
||||
mode = '${uci_set}obfs=' + Value['proxies'][$count]['plugin'].to_s
|
||||
mode = '${uci_set}obfs=\"' + Value['proxies'][$count]['plugin'].to_s + '\"'
|
||||
system(mode)
|
||||
#password
|
||||
if Value['proxies'][$count]['plugin-opts'].key?('password') then
|
||||
@ -596,7 +596,7 @@ do
|
||||
end
|
||||
end;
|
||||
if Value['proxies'][$count]['plugin'].to_s == 'restls' then
|
||||
mode = '${uci_set}obfs=' + Value['proxies'][$count]['plugin'].to_s
|
||||
mode = '${uci_set}obfs=\"' + Value['proxies'][$count]['plugin'].to_s + '\"'
|
||||
system(mode)
|
||||
#password
|
||||
if Value['proxies'][$count]['plugin-opts'].key?('password') then
|
||||
@ -624,7 +624,7 @@ do
|
||||
if Value['proxies'][$count]['cipher'].to_s == 'none' then
|
||||
cipher = '${uci_set}cipher_ssr=dummy'
|
||||
else
|
||||
cipher = '${uci_set}cipher_ssr=' + Value['proxies'][$count]['cipher'].to_s
|
||||
cipher = '${uci_set}cipher_ssr=\"' + Value['proxies'][$count]['cipher'].to_s + '\"'
|
||||
end
|
||||
system(cipher)
|
||||
end
|
||||
@ -633,7 +633,7 @@ do
|
||||
Thread.new{
|
||||
#obfs
|
||||
if Value['proxies'][$count].key?('obfs') then
|
||||
obfs = '${uci_set}obfs_ssr=' + Value['proxies'][$count]['obfs'].to_s
|
||||
obfs = '${uci_set}obfs_ssr=\"' + Value['proxies'][$count]['obfs'].to_s + '\"'
|
||||
system(obfs)
|
||||
end
|
||||
}.join
|
||||
@ -641,7 +641,7 @@ do
|
||||
Thread.new{
|
||||
#protocol
|
||||
if Value['proxies'][$count].key?('protocol') then
|
||||
protocol = '${uci_set}protocol=' + Value['proxies'][$count]['protocol'].to_s
|
||||
protocol = '${uci_set}protocol=\"' + Value['proxies'][$count]['protocol'].to_s + '\"'
|
||||
system(protocol)
|
||||
end
|
||||
}.join
|
||||
@ -666,7 +666,7 @@ do
|
||||
Thread.new{
|
||||
#uuid
|
||||
if Value['proxies'][$count].key?('uuid') then
|
||||
uuid = '${uci_set}uuid=' + Value['proxies'][$count]['uuid'].to_s
|
||||
uuid = '${uci_set}uuid=\"' + Value['proxies'][$count]['uuid'].to_s + '\"'
|
||||
system(uuid)
|
||||
end
|
||||
}.join
|
||||
@ -674,7 +674,7 @@ do
|
||||
Thread.new{
|
||||
#alterId
|
||||
if Value['proxies'][$count].key?('alterId') then
|
||||
alterId = '${uci_set}alterId=' + Value['proxies'][$count]['alterId'].to_s
|
||||
alterId = '${uci_set}alterId=\"' + Value['proxies'][$count]['alterId'].to_s + '\"'
|
||||
system(alterId)
|
||||
end
|
||||
}.join
|
||||
@ -682,7 +682,7 @@ do
|
||||
Thread.new{
|
||||
#cipher
|
||||
if Value['proxies'][$count].key?('cipher') then
|
||||
cipher = '${uci_set}securitys=' + Value['proxies'][$count]['cipher'].to_s
|
||||
cipher = '${uci_set}securitys=\"' + Value['proxies'][$count]['cipher'].to_s + '\"'
|
||||
system(cipher)
|
||||
end
|
||||
}.join
|
||||
@ -690,7 +690,7 @@ do
|
||||
Thread.new{
|
||||
#xudp
|
||||
if Value['proxies'][$count].key?('xudp') then
|
||||
xudp = '${uci_set}xudp=' + Value['proxies'][$count]['xudp'].to_s
|
||||
xudp = '${uci_set}xudp=\"' + Value['proxies'][$count]['xudp'].to_s + '\"'
|
||||
system(xudp)
|
||||
end
|
||||
}.join;
|
||||
@ -698,7 +698,7 @@ do
|
||||
Thread.new{
|
||||
#packet_encoding
|
||||
if Value['proxies'][$count].key?('packet-encoding') then
|
||||
packet_encoding = '${uci_set}packet_encoding=' + Value['proxies'][$count]['packet-encoding'].to_s
|
||||
packet_encoding = '${uci_set}packet_encoding=\"' + Value['proxies'][$count]['packet-encoding'].to_s + '\"'
|
||||
system(packet_encoding)
|
||||
end
|
||||
}.join;
|
||||
@ -706,7 +706,7 @@ do
|
||||
Thread.new{
|
||||
#GlobalPadding
|
||||
if Value['proxies'][$count].key?('global-padding') then
|
||||
global_padding = '${uci_set}global_padding=' + Value['proxies'][$count]['global-padding'].to_s
|
||||
global_padding = '${uci_set}global_padding=\"' + Value['proxies'][$count]['global-padding'].to_s + '\"'
|
||||
system(global_padding)
|
||||
end
|
||||
}.join;
|
||||
@ -714,7 +714,7 @@ do
|
||||
Thread.new{
|
||||
#authenticated_length
|
||||
if Value['proxies'][$count].key?('authenticated-length') then
|
||||
authenticated_length = '${uci_set}authenticated_length=' + Value['proxies'][$count]['authenticated-length'].to_s
|
||||
authenticated_length = '${uci_set}authenticated_length=\"' + Value['proxies'][$count]['authenticated-length'].to_s + '\"'
|
||||
system(authenticated_length)
|
||||
end
|
||||
}.join;
|
||||
@ -722,7 +722,7 @@ do
|
||||
Thread.new{
|
||||
#tls
|
||||
if Value['proxies'][$count].key?('tls') then
|
||||
tls = '${uci_set}tls=' + Value['proxies'][$count]['tls'].to_s
|
||||
tls = '${uci_set}tls=\"' + Value['proxies'][$count]['tls'].to_s + '\"'
|
||||
system(tls)
|
||||
end
|
||||
}.join
|
||||
@ -730,7 +730,7 @@ do
|
||||
Thread.new{
|
||||
#skip-cert-verify
|
||||
if Value['proxies'][$count].key?('skip-cert-verify') then
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=' + Value['proxies'][$count]['skip-cert-verify'].to_s
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=\"' + Value['proxies'][$count]['skip-cert-verify'].to_s + '\"'
|
||||
system(skip_cert_verify)
|
||||
end
|
||||
}.join
|
||||
@ -746,7 +746,7 @@ do
|
||||
Thread.new{
|
||||
#fingerprint
|
||||
if Value['proxies'][$count].key?('fingerprint') then
|
||||
fingerprint = '${uci_set}fingerprint=' + Value['proxies'][$count]['fingerprint'].to_s
|
||||
fingerprint = '${uci_set}fingerprint=\"' + Value['proxies'][$count]['fingerprint'].to_s + '\"'
|
||||
system(fingerprint)
|
||||
end
|
||||
}.join
|
||||
@ -754,7 +754,7 @@ do
|
||||
Thread.new{
|
||||
#client_fingerprint
|
||||
if Value['proxies'][$count].key?('client-fingerprint') then
|
||||
client_fingerprint = '${uci_set}client_fingerprint=' + Value['proxies'][$count]['client-fingerprint'].to_s
|
||||
client_fingerprint = '${uci_set}client_fingerprint=\"' + Value['proxies'][$count]['client-fingerprint'].to_s + '\"'
|
||||
system(client_fingerprint)
|
||||
end
|
||||
}.join
|
||||
@ -863,7 +863,7 @@ do
|
||||
Thread.new{
|
||||
#tc_ip
|
||||
if Value['proxies'][$count].key?('ip') then
|
||||
tc_ip = '${uci_set}tc_ip=' + Value['proxies'][$count]['ip'].to_s
|
||||
tc_ip = '${uci_set}tc_ip=\"' + Value['proxies'][$count]['ip'].to_s + '\"'
|
||||
system(tc_ip)
|
||||
end
|
||||
}.join
|
||||
@ -871,7 +871,7 @@ do
|
||||
Thread.new{
|
||||
#tc_token
|
||||
if Value['proxies'][$count].key?('token') then
|
||||
tc_token = '${uci_set}tc_token=' + Value['proxies'][$count]['token'].to_s
|
||||
tc_token = '${uci_set}tc_token=\"' + Value['proxies'][$count]['token'].to_s + '\"'
|
||||
system(tc_token)
|
||||
end
|
||||
}.join
|
||||
@ -879,7 +879,7 @@ do
|
||||
Thread.new{
|
||||
#heartbeat_interval
|
||||
if Value['proxies'][$count].key?('heartbeat-interval') then
|
||||
heartbeat_interval = '${uci_set}heartbeat_interval=' + Value['proxies'][$count]['heartbeat-interval'].to_s
|
||||
heartbeat_interval = '${uci_set}heartbeat_interval=\"' + Value['proxies'][$count]['heartbeat-interval'].to_s + '\"'
|
||||
system(heartbeat_interval)
|
||||
end
|
||||
}.join
|
||||
@ -899,7 +899,7 @@ do
|
||||
Thread.new{
|
||||
#disable_sni
|
||||
if Value['proxies'][$count].key?('disable-sni') then
|
||||
disable_sni = '${uci_set}disable_sni=' + Value['proxies'][$count]['disable-sni'].to_s
|
||||
disable_sni = '${uci_set}disable_sni=\"' + Value['proxies'][$count]['disable-sni'].to_s + '\"'
|
||||
system(disable_sni)
|
||||
end
|
||||
}.join
|
||||
@ -907,7 +907,7 @@ do
|
||||
Thread.new{
|
||||
#reduce_rtt
|
||||
if Value['proxies'][$count].key?('reduce-rtt') then
|
||||
reduce_rtt = '${uci_set}reduce_rtt=' + Value['proxies'][$count]['reduce-rtt'].to_s
|
||||
reduce_rtt = '${uci_set}reduce_rtt=\"' + Value['proxies'][$count]['reduce-rtt'].to_s + '\"'
|
||||
system(reduce_rtt)
|
||||
end
|
||||
}.join
|
||||
@ -915,7 +915,7 @@ do
|
||||
Thread.new{
|
||||
#fast_open
|
||||
if Value['proxies'][$count].key?('fast-open') then
|
||||
fast_open = '${uci_set}fast_open=' + Value['proxies'][$count]['fast-open'].to_s
|
||||
fast_open = '${uci_set}fast_open=\"' + Value['proxies'][$count]['fast-open'].to_s + '\"'
|
||||
system(fast_open)
|
||||
end
|
||||
}.join
|
||||
@ -923,7 +923,7 @@ do
|
||||
Thread.new{
|
||||
#request_timeout
|
||||
if Value['proxies'][$count].key?('request-timeout') then
|
||||
request_timeout = '${uci_set}request_timeout=' + Value['proxies'][$count]['request-timeout'].to_s
|
||||
request_timeout = '${uci_set}request_timeout=\"' + Value['proxies'][$count]['request-timeout'].to_s + '\"'
|
||||
system(request_timeout)
|
||||
end
|
||||
}.join
|
||||
@ -931,7 +931,7 @@ do
|
||||
Thread.new{
|
||||
#udp_relay_mode
|
||||
if Value['proxies'][$count].key?('udp-relay-mode') then
|
||||
udp_relay_mode = '${uci_set}udp_relay_mode=' + Value['proxies'][$count]['udp-relay-mode'].to_s
|
||||
udp_relay_mode = '${uci_set}udp_relay_mode=\"' + Value['proxies'][$count]['udp-relay-mode'].to_s + '\"'
|
||||
system(udp_relay_mode)
|
||||
end
|
||||
}.join
|
||||
@ -939,7 +939,7 @@ do
|
||||
Thread.new{
|
||||
#congestion_controller
|
||||
if Value['proxies'][$count].key?('congestion-controller') then
|
||||
congestion_controller = '${uci_set}congestion_controller=' + Value['proxies'][$count]['congestion-controller'].to_s
|
||||
congestion_controller = '${uci_set}congestion_controller=\"' + Value['proxies'][$count]['congestion-controller'].to_s + '\"'
|
||||
system(congestion_controller)
|
||||
end
|
||||
}.join
|
||||
@ -947,7 +947,7 @@ do
|
||||
Thread.new{
|
||||
#max_udp_relay_packet_size
|
||||
if Value['proxies'][$count].key?('max-udp-relay-packet-size') then
|
||||
max_udp_relay_packet_size = '${uci_set}max_udp_relay_packet_size=' + Value['proxies'][$count]['max-udp-relay-packet-size'].to_s
|
||||
max_udp_relay_packet_size = '${uci_set}max_udp_relay_packet_size=\"' + Value['proxies'][$count]['max-udp-relay-packet-size'].to_s + '\"'
|
||||
system(max_udp_relay_packet_size)
|
||||
end
|
||||
}.join
|
||||
@ -955,7 +955,7 @@ do
|
||||
Thread.new{
|
||||
#max-open-streams
|
||||
if Value['proxies'][$count].key?('max-open-streams') then
|
||||
max_open_streams = '${uci_set}max_open_streams=' + Value['proxies'][$count]['max-open-streams'].to_s
|
||||
max_open_streams = '${uci_set}max_open_streams=\"' + Value['proxies'][$count]['max-open-streams'].to_s + '\"'
|
||||
system(max_open_streams)
|
||||
end
|
||||
}.join
|
||||
@ -966,7 +966,7 @@ do
|
||||
Thread.new{
|
||||
#wg_ip
|
||||
if Value['proxies'][$count].key?('ip') then
|
||||
wg_ip = '${uci_set}wg_ip=' + Value['proxies'][$count]['ip'].to_s
|
||||
wg_ip = '${uci_set}wg_ip=\"' + Value['proxies'][$count]['ip'].to_s + '\"'
|
||||
system(wg_ip)
|
||||
end
|
||||
}.join
|
||||
@ -974,7 +974,7 @@ do
|
||||
Thread.new{
|
||||
#wg_ipv6
|
||||
if Value['proxies'][$count].key?('ipv6') then
|
||||
wg_ipv6 = '${uci_set}wg_ipv6=' + Value['proxies'][$count]['ipv6'].to_s
|
||||
wg_ipv6 = '${uci_set}wg_ipv6=\"' + Value['proxies'][$count]['ipv6'].to_s + '\"'
|
||||
system(wg_ipv6)
|
||||
end
|
||||
}.join
|
||||
@ -982,7 +982,7 @@ do
|
||||
Thread.new{
|
||||
#private_key
|
||||
if Value['proxies'][$count].key?('private-key') then
|
||||
private_key = '${uci_set}private_key=' + Value['proxies'][$count]['private-key'].to_s
|
||||
private_key = '${uci_set}private_key=\"' + Value['proxies'][$count]['private-key'].to_s + '\"'
|
||||
system(private_key)
|
||||
end
|
||||
}.join
|
||||
@ -990,7 +990,7 @@ do
|
||||
Thread.new{
|
||||
#public_key
|
||||
if Value['proxies'][$count].key?('public-key') then
|
||||
public_key = '${uci_set}public_key=' + Value['proxies'][$count]['public-key'].to_s
|
||||
public_key = '${uci_set}public_key=\"' + Value['proxies'][$count]['public-key'].to_s + '\"'
|
||||
system(public_key)
|
||||
end
|
||||
}.join
|
||||
@ -998,7 +998,7 @@ do
|
||||
Thread.new{
|
||||
#preshared_key
|
||||
if Value['proxies'][$count].key?('preshared-key') then
|
||||
preshared_key = '${uci_set}preshared_key=' + Value['proxies'][$count]['preshared-key'].to_s
|
||||
preshared_key = '${uci_set}preshared_key=\"' + Value['proxies'][$count]['preshared-key'].to_s + '\"'
|
||||
system(preshared_key)
|
||||
end
|
||||
}.join
|
||||
@ -1006,7 +1006,7 @@ do
|
||||
Thread.new{
|
||||
#wg_mtu
|
||||
if Value['proxies'][$count].key?('mtu') then
|
||||
wg_mtu = '${uci_set}wg_mtu=' + Value['proxies'][$count]['mtu'].to_s
|
||||
wg_mtu = '${uci_set}wg_mtu=\"' + Value['proxies'][$count]['mtu'].to_s + '\"'
|
||||
system(wg_mtu)
|
||||
end
|
||||
}.join
|
||||
@ -1028,7 +1028,7 @@ do
|
||||
Thread.new{
|
||||
#hysteria_protocol
|
||||
if Value['proxies'][$count].key?('protocol') then
|
||||
hysteria_protocol = '${uci_set}hysteria_protocol=' + Value['proxies'][$count]['protocol'].to_s
|
||||
hysteria_protocol = '${uci_set}hysteria_protocol=\"' + Value['proxies'][$count]['protocol'].to_s + '\"'
|
||||
system(hysteria_protocol)
|
||||
end
|
||||
}.join
|
||||
@ -1036,7 +1036,7 @@ do
|
||||
Thread.new{
|
||||
#hysteria_up
|
||||
if Value['proxies'][$count].key?('up') then
|
||||
hysteria_up = '${uci_set}hysteria_up=' + Value['proxies'][$count]['up'].to_s
|
||||
hysteria_up = '${uci_set}hysteria_up=\"' + Value['proxies'][$count]['up'].to_s + '\"'
|
||||
system(hysteria_up)
|
||||
end
|
||||
}.join
|
||||
@ -1044,7 +1044,7 @@ do
|
||||
Thread.new{
|
||||
#hysteria_down
|
||||
if Value['proxies'][$count].key?('down') then
|
||||
hysteria_down = '${uci_set}hysteria_down=' + Value['proxies'][$count]['down'].to_s
|
||||
hysteria_down = '${uci_set}hysteria_down=\"' + Value['proxies'][$count]['down'].to_s + '\"'
|
||||
system(hysteria_down)
|
||||
end
|
||||
}.join
|
||||
@ -1052,7 +1052,7 @@ do
|
||||
Thread.new{
|
||||
#skip-cert-verify
|
||||
if Value['proxies'][$count].key?('skip-cert-verify') then
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=' + Value['proxies'][$count]['skip-cert-verify'].to_s
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=\"' + Value['proxies'][$count]['skip-cert-verify'].to_s + '\"'
|
||||
system(skip_cert_verify)
|
||||
end
|
||||
}.join
|
||||
@ -1085,7 +1085,7 @@ do
|
||||
Thread.new{
|
||||
#recv_window_conn
|
||||
if Value['proxies'][$count].key?('recv-window-conn') then
|
||||
recv_window_conn = '${uci_set}recv_window_conn=' + Value['proxies'][$count]['recv-window-conn'].to_s
|
||||
recv_window_conn = '${uci_set}recv_window_conn=\"' + Value['proxies'][$count]['recv-window-conn'].to_s + '\"'
|
||||
system(recv_window_conn)
|
||||
end
|
||||
}.join
|
||||
@ -1093,7 +1093,7 @@ do
|
||||
Thread.new{
|
||||
#recv_window
|
||||
if Value['proxies'][$count].key?('recv-window') then
|
||||
recv_window = '${uci_set}recv_window=' + Value['proxies'][$count]['recv-window'].to_s
|
||||
recv_window = '${uci_set}recv_window=\"' + Value['proxies'][$count]['recv-window'].to_s + '\"'
|
||||
system(recv_window)
|
||||
end
|
||||
}.join
|
||||
@ -1101,14 +1101,15 @@ do
|
||||
Thread.new{
|
||||
#hysteria_obfs
|
||||
if Value['proxies'][$count].key?('obfs') then
|
||||
hysteria_obfs = '${uci_set}hysteria_obfs=' + Value['proxies'][$count]['obfs'].to_s
|
||||
hysteria_obfs = '${uci_set}hysteria_obfs=\"' + Value['proxies'][$count]['obfs'].to_s + '\"'
|
||||
system(hysteria_obfs)
|
||||
end
|
||||
}.join
|
||||
|
||||
Thread.new{
|
||||
#hysteria_obfs_password
|
||||
if Value['proxies'][$count].key?('obfs-password') then
|
||||
hysteria_obfs_password = '${uci_set}hysteria_obfs_password=' + Value['proxies'][$count]['obfs-password'].to_s
|
||||
hysteria_obfs_password = '${uci_set}hysteria_obfs_password=\"' + Value['proxies'][$count]['obfs-password'].to_s + '\"'
|
||||
system(hysteria_obfs_password)
|
||||
end
|
||||
}.join
|
||||
@ -1116,7 +1117,7 @@ do
|
||||
Thread.new{
|
||||
#hysteria_auth
|
||||
if Value['proxies'][$count].key?('auth') then
|
||||
hysteria_auth = '${uci_set}hysteria_auth=' + Value['proxies'][$count]['auth'].to_s
|
||||
hysteria_auth = '${uci_set}hysteria_auth=\"' + Value['proxies'][$count]['auth'].to_s + '\"'
|
||||
system(hysteria_auth)
|
||||
end
|
||||
}.join
|
||||
@ -1124,7 +1125,7 @@ do
|
||||
Thread.new{
|
||||
#hysteria_auth_str
|
||||
if Value['proxies'][$count].key?('auth-str') then
|
||||
hysteria_auth_str = '${uci_set}hysteria_auth_str=' + Value['proxies'][$count]['auth-str'].to_s
|
||||
hysteria_auth_str = '${uci_set}hysteria_auth_str=\"' + Value['proxies'][$count]['auth-str'].to_s + '\"'
|
||||
system(hysteria_auth_str)
|
||||
end
|
||||
}.join
|
||||
@ -1132,7 +1133,7 @@ do
|
||||
Thread.new{
|
||||
#hysteria_ca
|
||||
if Value['proxies'][$count].key?('ca') then
|
||||
hysteria_ca = '${uci_set}hysteria_ca=' + Value['proxies'][$count]['ca'].to_s
|
||||
hysteria_ca = '${uci_set}hysteria_ca=\"' + Value['proxies'][$count]['ca'].to_s + '\"'
|
||||
system(hysteria_ca)
|
||||
end
|
||||
}.join
|
||||
@ -1140,7 +1141,7 @@ do
|
||||
Thread.new{
|
||||
#hysteria_ca_str
|
||||
if Value['proxies'][$count].key?('ca-str') then
|
||||
hysteria_ca_str = '${uci_set}hysteria_ca_str=' + Value['proxies'][$count]['ca-str'].to_s
|
||||
hysteria_ca_str = '${uci_set}hysteria_ca_str=\"' + Value['proxies'][$count]['ca-str'].to_s + '\"'
|
||||
system(hysteria_ca_str)
|
||||
end
|
||||
}.join
|
||||
@ -1148,7 +1149,7 @@ do
|
||||
Thread.new{
|
||||
#disable_mtu_discovery
|
||||
if Value['proxies'][$count].key?('disable-mtu-discovery') then
|
||||
disable_mtu_discovery = '${uci_set}disable_mtu_discovery=' + Value['proxies'][$count]['disable-mtu-discovery'].to_s
|
||||
disable_mtu_discovery = '${uci_set}disable_mtu_discovery=\"' + Value['proxies'][$count]['disable-mtu-discovery'].to_s + '\"'
|
||||
system(disable_mtu_discovery)
|
||||
end
|
||||
}.join
|
||||
@ -1156,7 +1157,7 @@ do
|
||||
Thread.new{
|
||||
#fast_open
|
||||
if Value['proxies'][$count].key?('fast-open') then
|
||||
fast_open = '${uci_set}fast_open=' + Value['proxies'][$count]['fast-open'].to_s
|
||||
fast_open = '${uci_set}fast_open=\"' + Value['proxies'][$count]['fast-open'].to_s + '\"'
|
||||
system(fast_open)
|
||||
end
|
||||
}.join
|
||||
@ -1164,7 +1165,7 @@ do
|
||||
Thread.new{
|
||||
#fingerprint
|
||||
if Value['proxies'][$count].key?('fingerprint') then
|
||||
fingerprint = '${uci_set}fingerprint=' + Value['proxies'][$count]['fingerprint'].to_s
|
||||
fingerprint = '${uci_set}fingerprint=\"' + Value['proxies'][$count]['fingerprint'].to_s + '\"'
|
||||
system(fingerprint)
|
||||
end
|
||||
}.join
|
||||
@ -1172,7 +1173,7 @@ do
|
||||
Thread.new{
|
||||
#ports
|
||||
if Value['proxies'][$count].key?('ports') then
|
||||
ports = '${uci_set}ports=' + Value['proxies'][$count]['ports'].to_s
|
||||
ports = '${uci_set}ports=\"' + Value['proxies'][$count]['ports'].to_s + '\"'
|
||||
system(ports)
|
||||
end
|
||||
}.join
|
||||
@ -1180,7 +1181,7 @@ do
|
||||
Thread.new{
|
||||
#hop-interval
|
||||
if Value['proxies'][$count].key?('hop-interval') then
|
||||
hop_interval = '${uci_set}hop_interval=' + Value['proxies'][$count]['hop-interval'].to_s
|
||||
hop_interval = '${uci_set}hop_interval=\"' + Value['proxies'][$count]['hop-interval'].to_s + '\"'
|
||||
system(hop_interval)
|
||||
end
|
||||
}.join
|
||||
@ -1190,7 +1191,7 @@ do
|
||||
Thread.new{
|
||||
#uuid
|
||||
if Value['proxies'][$count].key?('uuid') then
|
||||
uuid = '${uci_set}uuid=' + Value['proxies'][$count]['uuid'].to_s
|
||||
uuid = '${uci_set}uuid=\"' + Value['proxies'][$count]['uuid'].to_s + '\"'
|
||||
system(uuid)
|
||||
end
|
||||
}.join
|
||||
@ -1198,7 +1199,7 @@ do
|
||||
Thread.new{
|
||||
#tls
|
||||
if Value['proxies'][$count].key?('tls') then
|
||||
tls = '${uci_set}tls=' + Value['proxies'][$count]['tls'].to_s
|
||||
tls = '${uci_set}tls=\"' + Value['proxies'][$count]['tls'].to_s + '\"'
|
||||
system(tls)
|
||||
end
|
||||
}.join
|
||||
@ -1206,7 +1207,7 @@ do
|
||||
Thread.new{
|
||||
#skip-cert-verify
|
||||
if Value['proxies'][$count].key?('skip-cert-verify') then
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=' + Value['proxies'][$count]['skip-cert-verify'].to_s
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=\"' + Value['proxies'][$count]['skip-cert-verify'].to_s + '\"'
|
||||
system(skip_cert_verify)
|
||||
end
|
||||
}.join
|
||||
@ -1286,7 +1287,7 @@ do
|
||||
Thread.new{
|
||||
#xudp
|
||||
if Value['proxies'][$count].key?('xudp') then
|
||||
xudp = '${uci_set}xudp=' + Value['proxies'][$count]['xudp'].to_s
|
||||
xudp = '${uci_set}xudp=\"' + Value['proxies'][$count]['xudp'].to_s + '\"'
|
||||
system(xudp)
|
||||
end
|
||||
}.join;
|
||||
@ -1294,7 +1295,7 @@ do
|
||||
Thread.new{
|
||||
#packet-addr
|
||||
if Value['proxies'][$count].key?('packet-addr') then
|
||||
packet_addr = '${uci_set}packet_addr=' + Value['proxies'][$count]['packet-addr'].to_s
|
||||
packet_addr = '${uci_set}packet_addr=\"' + Value['proxies'][$count]['packet-addr'].to_s + '\"'
|
||||
system(packet_addr)
|
||||
end
|
||||
}.join;
|
||||
@ -1302,7 +1303,7 @@ do
|
||||
Thread.new{
|
||||
#packet_encoding
|
||||
if Value['proxies'][$count].key?('packet-encoding') then
|
||||
packet_encoding = '${uci_set}packet_encoding=' + Value['proxies'][$count]['packet-encoding'].to_s
|
||||
packet_encoding = '${uci_set}packet_encoding=\"' + Value['proxies'][$count]['packet-encoding'].to_s + '\"'
|
||||
system(packet_encoding)
|
||||
end
|
||||
}.join;
|
||||
@ -1310,7 +1311,7 @@ do
|
||||
Thread.new{
|
||||
#fingerprint
|
||||
if Value['proxies'][$count].key?('fingerprint') then
|
||||
fingerprint = '${uci_set}fingerprint=' + Value['proxies'][$count]['fingerprint'].to_s
|
||||
fingerprint = '${uci_set}fingerprint=\"' + Value['proxies'][$count]['fingerprint'].to_s + '\"'
|
||||
system(fingerprint)
|
||||
end
|
||||
}.join
|
||||
@ -1318,7 +1319,7 @@ do
|
||||
Thread.new{
|
||||
#client_fingerprint
|
||||
if Value['proxies'][$count].key?('client-fingerprint') then
|
||||
client_fingerprint = '${uci_set}client_fingerprint=' + Value['proxies'][$count]['client-fingerprint'].to_s
|
||||
client_fingerprint = '${uci_set}client_fingerprint=\"' + Value['proxies'][$count]['client-fingerprint'].to_s + '\"'
|
||||
system(client_fingerprint)
|
||||
end
|
||||
}.join
|
||||
@ -1328,7 +1329,7 @@ do
|
||||
Thread.new{
|
||||
if Value['proxies'][$count].key?('obfs-opts') then
|
||||
if Value['proxies'][$count]['obfs-opts'].key?('mode') then
|
||||
mode = '${uci_set}obfs_snell=' + Value['proxies'][$count]['obfs-opts']['mode'].to_s
|
||||
mode = '${uci_set}obfs_snell=\"' + Value['proxies'][$count]['obfs-opts']['mode'].to_s + '\"'
|
||||
system(mode)
|
||||
else
|
||||
system '${uci_set}obfs_snell=none'
|
||||
@ -1342,14 +1343,14 @@ do
|
||||
|
||||
Thread.new{
|
||||
if Value['proxies'][$count].key?('psk') then
|
||||
psk = '${uci_set}psk=' + Value['proxies'][$count]['psk'].to_s
|
||||
psk = '${uci_set}psk=\"' + Value['proxies'][$count]['psk'].to_s + '\"'
|
||||
system(psk)
|
||||
end
|
||||
}.join
|
||||
|
||||
Thread.new{
|
||||
if Value['proxies'][$count].key?('version') then
|
||||
snell_version = '${uci_set}snell_version=' + Value['proxies'][$count]['version'].to_s
|
||||
snell_version = '${uci_set}snell_version=\"' + Value['proxies'][$count]['version'].to_s + '\"'
|
||||
system(snell_version)
|
||||
end
|
||||
}.join
|
||||
@ -1373,7 +1374,7 @@ do
|
||||
Thread.new{
|
||||
#tls
|
||||
if Value['proxies'][$count].key?('tls') then
|
||||
tls = '${uci_set}tls=' + Value['proxies'][$count]['tls'].to_s
|
||||
tls = '${uci_set}tls=\"' + Value['proxies'][$count]['tls'].to_s + '\"'
|
||||
system(tls)
|
||||
end
|
||||
}.join
|
||||
@ -1381,7 +1382,7 @@ do
|
||||
Thread.new{
|
||||
#skip-cert-verify
|
||||
if Value['proxies'][$count].key?('skip-cert-verify') then
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=' + Value['proxies'][$count]['skip-cert-verify'].to_s
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=\"' + Value['proxies'][$count]['skip-cert-verify'].to_s + '\"'
|
||||
system(skip_cert_verify)
|
||||
end
|
||||
}.join
|
||||
@ -1401,7 +1402,7 @@ do
|
||||
Thread.new{
|
||||
#fingerprint
|
||||
if Value['proxies'][$count].key?('fingerprint') then
|
||||
fingerprint = '${uci_set}fingerprint=' + Value['proxies'][$count]['fingerprint'].to_s
|
||||
fingerprint = '${uci_set}fingerprint=\"' + Value['proxies'][$count]['fingerprint'].to_s + '\"'
|
||||
system(fingerprint)
|
||||
end
|
||||
}.join
|
||||
@ -1468,7 +1469,7 @@ do
|
||||
Thread.new{
|
||||
#skip-cert-verify
|
||||
if Value['proxies'][$count].key?('skip-cert-verify') then
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=' + Value['proxies'][$count]['skip-cert-verify'].to_s
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=\"' + Value['proxies'][$count]['skip-cert-verify'].to_s + '\"'
|
||||
system(skip_cert_verify)
|
||||
end
|
||||
}.join
|
||||
@ -1476,7 +1477,7 @@ do
|
||||
Thread.new{
|
||||
#fingerprint
|
||||
if Value['proxies'][$count].key?('fingerprint') then
|
||||
fingerprint = '${uci_set}fingerprint=' + Value['proxies'][$count]['fingerprint'].to_s
|
||||
fingerprint = '${uci_set}fingerprint=\"' + Value['proxies'][$count]['fingerprint'].to_s + '\"'
|
||||
system(fingerprint)
|
||||
end
|
||||
}.join
|
||||
@ -1484,7 +1485,7 @@ do
|
||||
Thread.new{
|
||||
#client_fingerprint
|
||||
if Value['proxies'][$count].key?('client-fingerprint') then
|
||||
client_fingerprint = '${uci_set}client_fingerprint=' + Value['proxies'][$count]['client-fingerprint'].to_s
|
||||
client_fingerprint = '${uci_set}client_fingerprint=\"' + Value['proxies'][$count]['client-fingerprint'].to_s + '\"'
|
||||
system(client_fingerprint)
|
||||
end
|
||||
}.join
|
||||
|
Loading…
Reference in New Issue
Block a user