diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 98b4be6..7f213a0 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/version b/bin/version index cb3e807..8b0c057 100644 --- a/bin/version +++ b/bin/version @@ -3,4 +3,4 @@ clashpre_v=2022.11.25 clash_v=v1.7.1 meta_v=v1.13.2 GeoIP_v=20221203 -versionsh=1.6.12 +versionsh=1.6.12b diff --git a/scripts/clash.sh b/scripts/clash.sh index 77a47c7..7339e7e 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -1763,6 +1763,9 @@ case "$1" in shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash $shtype -x $clashdir/clash.sh ;; + -s) + $clashdir/start.sh $2 $3 $4 $5 $6 + ;; -st) shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash $shtype -x $clashdir/start.sh $2 $3 $4 $5 $6 diff --git a/scripts/start.sh b/scripts/start.sh index f12c585..baacd92 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -45,37 +45,40 @@ compare(){ fi } logger(){ + #$1文字描述$2显示颜色$3是否推送 [ -n "$2" ] && echo -e "\033[$2m$1\033[0m" log_text="$(date "+%G-%m-%d_%H:%M:%S")~$1" echo $log_text >> /tmp/ShellClash_log [ "$(wc -l /tmp/ShellClash_log | awk '{print $1}')" -gt 99 ] && sed -i '1,5d' /tmp/ShellClash_log - getconfig - [ -n "$(pidof clash)" ] && { - [ -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 - curl_data="-d chat_id=$chat_ID&text=$log_text" - wget_data="--post-data=$chat_ID&text=$log_text" - if curl --version &> /dev/null;then - curl -kfsSl -d "chat_id=$chat_ID&text=$log_text" "$url" &>/dev/null - else - wget -Y on -q --post-data="chat_id=$chat_ID&text=$log_text" "$url" - fi - } - [ -n "$push_bark" ] && { - url=${push_bark}/${log_text} - if curl --version &> /dev/null;then - curl -kfsSl "$url" &>/dev/null - else - wget -Y on -q "$url" - fi - } - [ -n "$push_Po" ] && { - url=https://api.pushover.net/1/messages.json - curl -kfsSl --form-string "token=$push_Po" --form-string "user=$push_Po_key" --form-string "message=$log_text" "$url" &>/dev/null - } + [ -z "$3" ] && { + getconfig + [ -n "$(pidof clash)" ] && { + [ -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 + curl_data="-d chat_id=$chat_ID&text=$log_text" + wget_data="--post-data=$chat_ID&text=$log_text" + if curl --version &> /dev/null;then + curl -kfsSl --connect-timeout 3 -d "chat_id=$chat_ID&text=$log_text" "$url" &>/dev/null + else + 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} + if curl --version &> /dev/null;then + curl -kfsSl --connect-timeout 3 "$url" &>/dev/null + else + wget -Y on -q --timeout=3 -t 1 "$url" + fi + } + [ -n "$push_Po" ] && { + 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(){ if [ -n "$(crontab -h 2>&1 | grep '\-l')" ];then @@ -1031,8 +1034,8 @@ afstart(){ #读取配置文件 getconfig #延迟启动 - [ -n "$start_delay" -a ! -f /tmp/clash_start_time ] && { - logger "clash将延迟$start_delay秒启动" 31 + [ ! -f /tmp/clash_start_time ] && [ -n "$start_delay" ] && [ "$start_delay" -gt 0 ] && { + logger "clash将延迟$start_delay秒启动" 31 pushoff sleep $start_delay } $bindir/clash -t -d $bindir >/dev/null