mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-08 04:26:55 +03:00
refactor: rename 'detour' to 'download_lists_via_proxy'
This commit is contained in:
@@ -197,7 +197,7 @@ function createSettingsContent(section) {
|
|||||||
|
|
||||||
o = section.option(
|
o = section.option(
|
||||||
form.Flag,
|
form.Flag,
|
||||||
'detour',
|
'download_lists_via_proxy',
|
||||||
_('Download Lists via Proxy/VPN'),
|
_('Download Lists via Proxy/VPN'),
|
||||||
_('Downloading all lists via main Proxy/VPN'),
|
_('Downloading all lists via main Proxy/VPN'),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -470,8 +470,8 @@ list_update() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for i in $(seq 1 60); do
|
for i in $(seq 1 60); do
|
||||||
config_get_bool detour "settings" "detour" "0"
|
config_get_bool download_lists_via_proxy "settings" "download_lists_via_proxy" "0"
|
||||||
if [ "$detour" -eq 1 ]; then
|
if [ "$download_lists_via_proxy" -eq 1 ]; then
|
||||||
if http_proxy="http://127.0.0.1:4534" https_proxy="http://127.0.0.1:4534" curl -s -m 3 https://github.com > /dev/null; then
|
if http_proxy="http://127.0.0.1:4534" https_proxy="http://127.0.0.1:4534" curl -s -m 3 https://github.com > /dev/null; then
|
||||||
echolog "✅ GitHub connection check passed (via proxy)"
|
echolog "✅ GitHub connection check passed (via proxy)"
|
||||||
break
|
break
|
||||||
@@ -1177,7 +1177,7 @@ import_community_service_subnet_list_handler() {
|
|||||||
*) return 0 ;;
|
*) return 0 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
local tmpfile detour http_proxy_address subnets
|
local tmpfile http_proxy_address subnets
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
http_proxy_address="$(get_service_proxy_address)"
|
http_proxy_address="$(get_service_proxy_address)"
|
||||||
|
|
||||||
@@ -1345,9 +1345,9 @@ import_subnets_from_remote_srs_file() {
|
|||||||
|
|
||||||
## Support functions
|
## Support functions
|
||||||
get_service_proxy_address() {
|
get_service_proxy_address() {
|
||||||
local detour
|
local download_lists_via_proxy
|
||||||
config_get_bool detour "settings" "detour" 0
|
config_get_bool download_lists_via_proxy "settings" "download_lists_via_proxy" 0
|
||||||
if [ "$detour" -eq 1 ]; then
|
if [ "$download_lists_via_proxy" -eq 1 ]; then
|
||||||
echo "$SB_SERVICE_MIXED_INBOUND_ADDRESS:$SB_SERVICE_MIXED_INBOUND_PORT"
|
echo "$SB_SERVICE_MIXED_INBOUND_ADDRESS:$SB_SERVICE_MIXED_INBOUND_PORT"
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
@@ -1355,8 +1355,8 @@ get_service_proxy_address() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_download_detour_tag() {
|
get_download_detour_tag() {
|
||||||
config_get_bool detour "settings" "detour" 0
|
config_get_bool download_lists_via_proxy "settings" "download_lists_via_proxy" 0
|
||||||
if [ "${detour:-0}" -eq 1 ]; then
|
if [ "$download_lists_via_proxy" -eq 1 ]; then
|
||||||
echo "$SB_MAIN_OUTBOUND_TAG"
|
echo "$SB_MAIN_OUTBOUND_TAG"
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
@@ -1573,8 +1573,8 @@ check_github() {
|
|||||||
"$SUBNETS_TWITTER" "$SUBNETS_META" "$SUBNETS_DISCORD"; do
|
"$SUBNETS_TWITTER" "$SUBNETS_META" "$SUBNETS_DISCORD"; do
|
||||||
local list_name=$(basename "$url")
|
local list_name=$(basename "$url")
|
||||||
|
|
||||||
config_get_bool detour "settings" "detour" "0"
|
config_get_bool download_lists_via_proxy "settings" "download_lists_via_proxy" "0"
|
||||||
if [ "$detour" -eq 1 ]; then
|
if [ "$download_lists_via_proxy" -eq 1 ]; then
|
||||||
http_proxy="http://127.0.0.1:4534" https_proxy="http://127.0.0.1:4534" wget -q -O /dev/null "$url"
|
http_proxy="http://127.0.0.1:4534" https_proxy="http://127.0.0.1:4534" wget -q -O /dev/null "$url"
|
||||||
else
|
else
|
||||||
wget -q -O /dev/null "$url"
|
wget -q -O /dev/null "$url"
|
||||||
|
|||||||
Reference in New Issue
Block a user