为bark日志推送添加了请求参数的配置

This commit is contained in:
少先队员陈同学
2023-06-07 13:56:55 +08:00
parent 3f154466ea
commit df3c46dae4
2 changed files with 11 additions and 1 deletions

View File

@@ -291,7 +291,9 @@ log_pusher(){
read -p "确认关闭Bark日志推送(1/0) > " res read -p "确认关闭Bark日志推送(1/0) > " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
push_bark= push_bark=
bark_param=
setconfig push_bark setconfig push_bark
setconfig bark_param
} }
else else
#echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m" #echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m"
@@ -302,6 +304,14 @@ log_pusher(){
if [ -n "$url" ];then if [ -n "$url" ];then
push_bark=$url push_bark=$url
setconfig push_bark $url setconfig push_bark $url
echo -----------------------------------------------
echo -e "\033[32m例: ?group=ShellClash\033[0m"
read -p "请输入你的Bark请求参数(默认回车为空) > " param
param=$(echo $param | sed 's/\&/\\\&/g')
if [ -n "$param" ];then
bark_param=$param
setconfig bark_param \'$param\'
fi
$clashdir/start.sh logger "已完成Bark日志推送设置" 32 $clashdir/start.sh logger "已完成Bark日志推送设置" 32
else else
echo -e "\033[31m输入错误请重新输入\033[0m" echo -e "\033[31m输入错误请重新输入\033[0m"

View File

@@ -74,7 +74,7 @@ logger(){
fi fi
} }
[ -n "$push_bark" ] && { [ -n "$push_bark" ] && {
url=${push_bark}/${log_text} url=${push_bark}/${log_text}${bark_param}
if curl --version &> /dev/null;then if curl --version &> /dev/null;then
curl -kfsSl --connect-timeout 3 "$url" &>/dev/null curl -kfsSl --connect-timeout 3 "$url" &>/dev/null
else else