v1.6.12
~内置下载功能防滥用优化 ~移除fastgit源 ~域名嗅探默认改为未启用 ~本机hosts生成优先读取user.yaml ~其他优化及若干bug修复 ~修复日志推送导致的部分卡死
This commit is contained in:
Binary file not shown.
@@ -3,4 +3,4 @@ clashpre_v=2022.11.25
|
|||||||
clash_v=v1.7.1
|
clash_v=v1.7.1
|
||||||
meta_v=v1.13.2
|
meta_v=v1.13.2
|
||||||
GeoIP_v=20221203
|
GeoIP_v=20221203
|
||||||
versionsh=1.6.12
|
versionsh=1.6.12b
|
||||||
|
|||||||
@@ -1763,6 +1763,9 @@ case "$1" in
|
|||||||
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
|
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
|
||||||
$shtype -x $clashdir/clash.sh
|
$shtype -x $clashdir/clash.sh
|
||||||
;;
|
;;
|
||||||
|
-s)
|
||||||
|
$clashdir/start.sh $2 $3 $4 $5 $6
|
||||||
|
;;
|
||||||
-st)
|
-st)
|
||||||
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
|
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
|
||||||
$shtype -x $clashdir/start.sh $2 $3 $4 $5 $6
|
$shtype -x $clashdir/start.sh $2 $3 $4 $5 $6
|
||||||
|
|||||||
@@ -45,37 +45,40 @@ compare(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
logger(){
|
logger(){
|
||||||
|
#$1文字描述$2显示颜色$3是否推送
|
||||||
[ -n "$2" ] && echo -e "\033[$2m$1\033[0m"
|
[ -n "$2" ] && echo -e "\033[$2m$1\033[0m"
|
||||||
log_text="$(date "+%G-%m-%d_%H:%M:%S")~$1"
|
log_text="$(date "+%G-%m-%d_%H:%M:%S")~$1"
|
||||||
echo $log_text >> /tmp/ShellClash_log
|
echo $log_text >> /tmp/ShellClash_log
|
||||||
[ "$(wc -l /tmp/ShellClash_log | awk '{print $1}')" -gt 99 ] && sed -i '1,5d' /tmp/ShellClash_log
|
[ "$(wc -l /tmp/ShellClash_log | awk '{print $1}')" -gt 99 ] && sed -i '1,5d' /tmp/ShellClash_log
|
||||||
getconfig
|
[ -z "$3" ] && {
|
||||||
[ -n "$(pidof clash)" ] && {
|
getconfig
|
||||||
[ -n "$authentication" ] && auth="$authentication@"
|
[ -n "$(pidof clash)" ] && {
|
||||||
export https_proxy="http://${auth}127.0.0.1:$mix_port"
|
[ -n "$authentication" ] && auth="$authentication@"
|
||||||
}
|
export https_proxy="http://${auth}127.0.0.1:$mix_port"
|
||||||
[ -n "$push_TG" ] && {
|
}
|
||||||
url=https://api.telegram.org/bot${push_TG}/sendMessage
|
[ -n "$push_TG" ] && {
|
||||||
curl_data="-d chat_id=$chat_ID&text=$log_text"
|
url=https://api.telegram.org/bot${push_TG}/sendMessage
|
||||||
wget_data="--post-data=$chat_ID&text=$log_text"
|
curl_data="-d chat_id=$chat_ID&text=$log_text"
|
||||||
if curl --version &> /dev/null;then
|
wget_data="--post-data=$chat_ID&text=$log_text"
|
||||||
curl -kfsSl -d "chat_id=$chat_ID&text=$log_text" "$url" &>/dev/null
|
if curl --version &> /dev/null;then
|
||||||
else
|
curl -kfsSl --connect-timeout 3 -d "chat_id=$chat_ID&text=$log_text" "$url" &>/dev/null
|
||||||
wget -Y on -q --post-data="chat_id=$chat_ID&text=$log_text" "$url"
|
else
|
||||||
fi
|
wget -Y on -q --timeout=3 -t 1 --post-data="chat_id=$chat_ID&text=$log_text" "$url"
|
||||||
}
|
fi
|
||||||
[ -n "$push_bark" ] && {
|
}
|
||||||
url=${push_bark}/${log_text}
|
[ -n "$push_bark" ] && {
|
||||||
if curl --version &> /dev/null;then
|
url=${push_bark}/${log_text}
|
||||||
curl -kfsSl "$url" &>/dev/null
|
if curl --version &> /dev/null;then
|
||||||
else
|
curl -kfsSl --connect-timeout 3 "$url" &>/dev/null
|
||||||
wget -Y on -q "$url"
|
else
|
||||||
fi
|
wget -Y on -q --timeout=3 -t 1 "$url"
|
||||||
}
|
fi
|
||||||
[ -n "$push_Po" ] && {
|
}
|
||||||
url=https://api.pushover.net/1/messages.json
|
[ -n "$push_Po" ] && {
|
||||||
curl -kfsSl --form-string "token=$push_Po" --form-string "user=$push_Po_key" --form-string "message=$log_text" "$url" &>/dev/null
|
url=https://api.pushover.net/1/messages.json
|
||||||
}
|
curl -kfsSl --connect-timeout 3 --form-string "token=$push_Po" --form-string "user=$push_Po_key" --form-string "message=$log_text" "$url" &>/dev/null
|
||||||
|
}
|
||||||
|
} &
|
||||||
}
|
}
|
||||||
croncmd(){
|
croncmd(){
|
||||||
if [ -n "$(crontab -h 2>&1 | grep '\-l')" ];then
|
if [ -n "$(crontab -h 2>&1 | grep '\-l')" ];then
|
||||||
@@ -1031,8 +1034,8 @@ afstart(){
|
|||||||
#读取配置文件
|
#读取配置文件
|
||||||
getconfig
|
getconfig
|
||||||
#延迟启动
|
#延迟启动
|
||||||
[ -n "$start_delay" -a ! -f /tmp/clash_start_time ] && {
|
[ ! -f /tmp/clash_start_time ] && [ -n "$start_delay" ] && [ "$start_delay" -gt 0 ] && {
|
||||||
logger "clash将延迟$start_delay秒启动" 31
|
logger "clash将延迟$start_delay秒启动" 31 pushoff
|
||||||
sleep $start_delay
|
sleep $start_delay
|
||||||
}
|
}
|
||||||
$bindir/clash -t -d $bindir >/dev/null
|
$bindir/clash -t -d $bindir >/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user