mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
Merge branch 'master' into dev
This commit is contained in:
@@ -3,6 +3,7 @@ setproxy(){
|
||||
[ -n "$(pidof CrashCore)" ] && {
|
||||
[ -n "$authentication" ] && auth="$authentication@" || auth=""
|
||||
[ -z "$mix_port" ] && mix_port=7890
|
||||
export all_proxy="http://${auth}127.0.0.1:$mix_port"
|
||||
export https_proxy="http://${auth}127.0.0.1:$mix_port"
|
||||
export http_proxy="http://${auth}127.0.0.1:$mix_port"
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,8 @@ webget(){
|
||||
result=$(curl $agent -w '%{http_code}' --connect-timeout 3 $progress $redirect $certificate -o "$1" "$url")
|
||||
fi
|
||||
[ "$result" = "200" ] && return 0 #成功则退出否则重试
|
||||
export all_proxy=""
|
||||
export https_proxy=""
|
||||
export http_proxy=""
|
||||
result=$(curl $agent -w '%{http_code}' --connect-timeout 5 $progress $redirect $certificate -o "$1" "$2")
|
||||
[ "$result" = "200" ]
|
||||
return $?
|
||||
|
||||
@@ -20,11 +20,13 @@ web_save() { #最小化保存面板节点选择
|
||||
}
|
||||
done <"$TMPDIR"/web_proxies
|
||||
rm -rf "$TMPDIR"/web_proxies
|
||||
#对比文件,如果有变动且不为空则写入磁盘,否则清除缓存
|
||||
for file in web_save web_configs; do
|
||||
if [ -s "$TMPDIR"/${file} ]; then
|
||||
. "$CRASHDIR"/libs/compare.sh && compare "$TMPDIR"/${file} "$CRASHDIR"/configs/${file}
|
||||
[ "$?" = 0 ] && rm -rf "$TMPDIR"/${file} || mv -f "$TMPDIR"/${file} "$CRASHDIR"/configs/${file}
|
||||
#对比文件,如果有变动则写入磁盘,否则清除缓存
|
||||
for file in web_save; do
|
||||
if [ -s "$TMPDIR/$file" ]; then
|
||||
. "$CRASHDIR"/libs/compare.sh && compare "$TMPDIR/$file" "$CRASHDIR/configs/$file"
|
||||
[ "$?" = 0 ] && rm -f "$TMPDIR/$file" || mv -f "$TMPDIR/$file" "$CRASHDIR/configs/$file"
|
||||
else
|
||||
rm -f "$CRASHDIR/configs/$file" #空文件时移除旧文件
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user