Skip to content

Commit

Permalink
0.46.058
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Dec 6, 2024
1 parent 4adeb27 commit 9764e5b
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 84 deletions.
2 changes: 1 addition & 1 deletion luci-app-openclash/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.46.057
PKG_VERSION:=0.46.058
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ o:value("http://captive.apple.com/generate_204")
o.default = "0"

o = s:taboption("settings", Value, "github_address_mod", translate("Github Address Modify"))
o.description = translate("Modify The Github Address In The Config And OpenClash With Proxy(CDN) To Prevent File Download Faild. Format Reference:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://mirror.ghproxy.com/\")'>https://mirror.ghproxy.com/</a>"
o.description = translate("Modify The Github Address In The Config And OpenClash With Proxy(CDN) To Prevent File Download Faild. Format Reference:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://ghp.ci/\")'>https://ghp.ci/</a>"
o:value("0", translate("Disable"))
o:value("https://fastly.jsdelivr.net/")
o:value("https://testingcf.jsdelivr.net/")
o:value("https://raw.fastgit.org/")
o:value("https://cdn.jsdelivr.net/")
o.default = "0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ end
---- UA
o = s:option(Value, "sub_ua", "User-Agent")
o.description = font_red..bold_on..translate("Used for Downloading Subscriptions, Defaults to Clash")..bold_off..font_off
o:value("Clash")
o:value("clash.meta")
o.default = "Clash"
o:value("clash-verge/v1.5.1")
o:value("Clash")
o.default = "clash.meta"
o.rmempty = true

---- subconverter
Expand Down
4 changes: 0 additions & 4 deletions luci-app-openclash/luasrc/model/cbi/openclash/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ o = s:taboption("op_mode", Value, "log_size", translate("Log Size (KB)"))
o.description = translate("Set Log File Size (KB)")
o.default = "1024"

o = s:taboption("op_mode", Flag, "test_before_start", translate("Test Before Start"))
o.description = translate("Test Config Before Core Start")
o.default = 0

o = s:taboption("op_mode", Flag, "bypass_gateway_compatible", translate("Bypass Gateway Compatible"))
o.description = translate("If The Network Cannot be Connected in Bypass Gateway Mode, Please Try to Enable.")..font_red..bold_on..translate("Suggestion: If The Device Does Not Have WLAN, Please Disable The Lan Interface's Bridge Option")..bold_off..font_off
o.default = 0
Expand Down
3 changes: 1 addition & 2 deletions luci-app-openclash/luasrc/view/openclash/select_git_cdn.htm
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@
<div class="select-popup-body">
<div class="select-option" data-value="https://fastly.jsdelivr.net/">https://fastly.jsdelivr.net/</div>
<div class="select-option" data-value="https://testingcf.jsdelivr.net/">https://testingcf.jsdelivr.net/</div>
<div class="select-option" data-value="https://raw.fastgit.org/">https://raw.fastgit.org/</div>
<div class="select-option" data-value="https://cdn.jsdelivr.net/">https://cdn.jsdelivr.net/</div>
<div class="select-option" data-value="custom"><%:Custom Your CDN URL%></div>
<input type="text" id="customOptionInput" class="custom-option-input" value="https://mirror.ghproxy.com/" placeholder="<%:Type CDN URL, Format Like%> https://mirror.ghproxy.com/" style="display: none;">
<input type="text" id="customOptionInput" class="custom-option-input" value="https://ghp.ci/" placeholder="<%:Type CDN URL, Format Like%> https://ghp.ci/" style="display: none;">
<div class="select-option" id="addCustomOption" style="display: none;"><%:Add%></div>
</div>
</div>
Expand Down
8 changes: 1 addition & 7 deletions luci-app-openclash/po/zh-cn/openclash.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -3430,10 +3430,4 @@ msgid "Direct"
msgstr "直连"

msgid "Error: Config File Overwrite Failed,"
msgstr "错误:配置文件覆写失败,"

msgid "Test Config Before Core Start"
msgstr "启动前调用内核测试配置文件"

msgid "Test Before Start"
msgstr "启动前测试"
msgstr "错误:配置文件覆写失败,"
1 change: 0 additions & 1 deletion luci-app-openclash/root/etc/config/openclash
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ config openclash 'config'
option auto_update '0'
option auto_update_time '0'
option cn_port '9090'
option dashboard_password '123456'
option dashboard_forward_ssl '0'
option rule_source '0'
option enable_custom_dns '0'
Expand Down
31 changes: 6 additions & 25 deletions luci-app-openclash/root/etc/init.d/openclash
Original file line number Diff line number Diff line change
Expand Up @@ -660,27 +660,6 @@ do_run_file()

}

config_test()
{
if [ -f "$CLASH" ] && [ "$test_before_start" -eq 1 ]; then
LOG_OUT "Test The Config File First..."
test_info=$(nohup $CLASH -t -d $CLASH_CONFIG -f "$CONFIG_FILE")
local IFS=$'\n'
for i in $test_info; do
if [ -n "$(echo "$i" |grep "configuration file")" ]; then
local info=$(echo "$i" |sed "s# ${CONFIG_FILE} #【${CONFIG_FILE}】#g")
LOG_OUT "$info"
else
echo "$i" >> "$LOG_FILE"
fi
done
if [ -n "$(echo "$test_info" |grep "test failed")" ]; then
LOG_OUT "Error: Config File Tested Faild, Please Check The Log Infos!"
start_fail
fi
fi
}

start_run_core()
{
ulimit -SHn 65535 2>/dev/null
Expand All @@ -690,7 +669,6 @@ start_run_core()
if ! $quick_start; then
mv "$TMP_CONFIG_FILE" "$CONFIG_FILE" 2>/dev/null
rm -rf "$TMP_CONFIG_FILE" 2>/dev/null
config_test
fi
chown root:root /etc/openclash/core/* 2>/dev/null
kill_clash
Expand Down Expand Up @@ -826,12 +804,16 @@ check_core_status()
ip rule add fwmark "$PROXY_FWMARK" ipproto icmp table main pref 8000
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" pref 8001
else
while ( [ -n "$(pidof clash)" ] && [ "$CORE_HTTP_CODE" != "200" ] && [ "$TUN_RESTART" -le 120 ] )
reg4='^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$'
while ( [ -n "$(pidof clash)" ] && [ "$CORE_HTTP_CODE" != "200" ] && [ "$TUN_RESTART" -le 120 ] && [[ "$lan_ip" =~ $reg4 ]] )
do
CORE_HTTP_CODE=$(curl -m 5 -o /dev/null -s -w '%{http_code}' -H 'Content-Type: application/json' -H "Authorization: Bearer ${da_password}" -XGET http://${lan_ip}:${cn_port}/group)
let TUN_WAIT++
sleep 1
done >/dev/null 2>&1
if ! [[ "$lan_ip" =~ $reg4 ]]; then
sleep 10
fi
if [ -z "$(pidof clash)" ]; then
LOG_OUT "Error: Core Start Failed, Please Check The Log Infos!"
start_fail
Expand Down Expand Up @@ -2890,8 +2872,8 @@ get_config()
fakeip_range=$(uci -q get openclash.config.fakeip_range)
fi
[ -z "$fakeip_range" ] && fakeip_range="198.18.0.1/16"
lan_interface_name=$(uci -q get openclash.config.lan_interface_name || echo 0)

lan_interface_name=$(uci -q get openclash.config.lan_interface_name || echo 0)
if [ "$lan_interface_name" = "0" ]; then
lan_ip=$(uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null || ip address show $(uci -q -p /tmp/state get network.lan.ifname || uci -q -p /tmp/state get network.lan.device) | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' |head -1 || ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1)
else
Expand Down Expand Up @@ -2936,7 +2918,6 @@ get_config()
intranet_allowed_wan_name=$(uci -q get openclash.config.intranet_allowed_wan_name || echo 0)
custom_fakeip_filter_mode=$(uci -q get openclash.config.custom_fakeip_filter_mode || echo "blacklist")
iptables_compat=$(iptables -m owner -h 2>/dev/null | grep "owner match options" || echo 0)
test_before_start=$(uci -q get openclash.config.test_before_start || echo 0)
[ -z "$dns_port" ] && dns_port=7874 && uci -q set openclash.config.dns_port=7874
uci -q commit openclash
}
Expand Down
20 changes: 12 additions & 8 deletions luci-app-openclash/root/etc/uci-defaults/luci-openclash
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ cat > "/lib/upgrade/keep.d/luci-app-openclash" <<-EOF
EOF

#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 -q 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)"
if [ -z "$(uci -q get openclash.config.dashboard_password)" ]; then
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)"
fi

#Set Authentication
if [ -z "$(uci -q get openclash.@authentication[0])" ]; then
uci_name_tmp=$(uci -q 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

#Set Core Model
source "/etc/openwrt_release"
Expand Down
2 changes: 0 additions & 2 deletions luci-app-openclash/root/usr/share/openclash/clash_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ if [ "$TIME" != "$CHTIME" ]; then
if [ "$github_address_mod" != "0" ]; then
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then
curl -SsL -m 60 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then
curl -SsL -m 60 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
else
curl -SsL -m 60 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/core_version -o $LAST_OPVER 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$LAST_OPVER" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
fi
Expand Down
2 changes: 0 additions & 2 deletions luci-app-openclash/root/usr/share/openclash/openclash_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
if [ "$github_address_mod" != "0" ]; then
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/vernesong/OpenClash@core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
else
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/core/"$RELEASE_BRANCH"/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/clash_meta.tar.gz" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ urlencode() {
if [ "$github_address_mod" != "0" ]; then
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/FQrabbit/SSTap-Rule@master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"FQrabbit/SSTap-Rule/master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
else
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/FQrabbit/SSTap-Rule/master/rules/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
fi
Expand All @@ -48,8 +46,6 @@ urlencode() {
if [ "$github_address_mod" != "0" ]; then
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/"$(echo "$DOWNLOAD_PATH" |awk -F '/master' '{print $1}' 2>/dev/null)"@master"$(echo "$DOWNLOAD_PATH" |awk -F 'master' '{print $2}')" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod""$(echo "$DOWNLOAD_PATH" |awk -F '/master' '{print $1}' 2>/dev/null)"/master"$(echo "$DOWNLOAD_PATH" |awk -F 'master' '{print $2}')" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
else
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/"$DOWNLOAD_PATH" -o "$TMP_RULE_DIR" 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="$TMP_RULE_DIR" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
if [ "$github_address_mod" != "0" ]; then
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "${github_address_mod}gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat" -o /tmp/GeoIP.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "https://raw.fastgit.org/Loyalsoldier/v2ray-rules-dat/release/geoip.dat" -o /tmp/GeoIP.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
else
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -o /tmp/GeoIP.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoIP.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
if [ "$github_address_mod" != "0" ]; then
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat -o /tmp/GeoSite.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/Loyalsoldier/v2ray-rules-dat/release/geosite.dat -o /tmp/GeoSite.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
else
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o /tmp/GeoSite.dat 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/GeoSite.dat" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
fi
Expand Down
2 changes: 0 additions & 2 deletions luci-app-openclash/root/usr/share/openclash/openclash_ipdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
if [ "$github_address_mod" != "0" ]; then
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ] || [ "$github_address_mod" == "https://fastly.jsdelivr.net/" ] || [ "$github_address_mod" == "https://testingcf.jsdelivr.net/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
elif [ "$github_address_mod" == "https://raw.fastgit.org/" ]; then
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 https://raw.fastgit.org/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
else
curl -SsL --connect-timeout 30 -m 60 --speed-time 30 --speed-limit 1 --retry 2 "$github_address_mod"https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb -o /tmp/Country.mmdb 2>&1 |sed ':a;N;$!ba; s/\n/ /g' | awk -v time="$(date "+%Y-%m-%d %H:%M:%S")" -v file="/tmp/Country.mmdb" '{print time "【" file "】Download Failed:【"$0"】"}' >> "$LOG_FILE"
fi
Expand Down
Loading

0 comments on commit 9764e5b

Please sign in to comment.