update-09.11

This commit is contained in:
github-actions[bot]
2021-09-11 08:28:29 +08:00
parent 63d0b84d5c
commit 2308d50344
6 changed files with 69 additions and 54 deletions

View File

@@ -4,14 +4,16 @@ PKG_NAME:=luci-app-jd-dailybonus
PKG_VERSION:=1.0.5 PKG_VERSION:=1.0.5
PKG_RELEASE:=20210316 PKG_RELEASE:=20210316
define Package/$(PKG_NAME)/conffiles PKG_MAINTAINER:=jerrykuku <jerrykuku@qq.com>
/etc/config/jd-dailybonus
endef
LUCI_TITLE:=Luci for JD dailybonus Script LUCI_TITLE:=Luci for JD dailybonus Script
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
LUCI_DEPENDS:=+node +uclient-fetch +lua +libuci-lua LUCI_DEPENDS:=+node +uclient-fetch +lua +libuci-lua
define Package/$(PKG_NAME)/conffiles
/etc/config/jd-dailybonus
endef
include $(TOPDIR)/feeds/luci/luci.mk include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature # call BuildPackage - OpenWrt buildroot signature

View File

@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-pushbot PKG_NAME:=luci-app-pushbot
PKG_VERSION:=3.50 PKG_VERSION:=3.55
PKG_RELEASE:=2 PKG_RELEASE:=3
PKG_MAINTAINER:=tty228 zzsj0928 PKG_MAINTAINER:=tty228 zzsj0928

View File

@@ -28,6 +28,9 @@
- 故由 然后七年 @zzsj0928 重新修改为本插件为钉钉机器人API使用。 - 故由 然后七年 @zzsj0928 重新修改为本插件为钉钉机器人API使用。
- 本插件工作在openwrt - 本插件工作在openwrt
- 本插件支持:钉钉推送,企业微信推送,PushPlus推送,微信推送,企业微信应用推送,飞书推送,钉钉机器人推送,企业微信机器人推送,飞书机器人推送,一对多推送,Bark推送(仅iOS) - 本插件支持:钉钉推送,企业微信推送,PushPlus推送,微信推送,企业微信应用推送,飞书推送,钉钉机器人推送,企业微信机器人推送,飞书机器人推送,一对多推送,Bark推送(仅iOS)
- 自20210911之后的版本支持Bark群组群组名默认为设备名
- 自20210901之后的版本增加依赖jq请重新编译或在安装前同步安装jq
# 显示效果 # 显示效果
## 通知栏:直接显示推送主题,一目了然,按设备不同,分组显示 ## 通知栏:直接显示推送主题,一目了然,按设备不同,分组显示
<img src="https://raw.githubusercontent.com/zzsj0928/ReadmeContents/main/Serverchand/Msg.Notification.jpg" width="500"> <img src="https://raw.githubusercontent.com/zzsj0928/ReadmeContents/main/Serverchand/Msg.Notification.jpg" width="500">

View File

@@ -2,15 +2,15 @@
"_api": "这是Bark推送 post 模板信息 api 文件", "_api": "这是Bark推送 post 模板信息 api 文件",
"_api": "【Bark推送】", "_api": "【Bark推送】",
"url": "${bark_srv}/${bark_token}/${1}/${nowtime}${markdown_linefeed}${2}?isArchive=1", "url": "",
"data": "@${tempjsonpath}", "data": "@${tempjsonpath}",
"content_type": "Content-Type: application/json", "content_type": "",
"str_title_start": "【", "str_title_start": "【",
"str_title_end": "】", "str_title_end": "】",
"str_linefeed": "\\n", "str_linefeed": "%0D%0A%0D%0A",
"str_splitline": "\\n\\n", "str_splitline": "%0D%0A%0D%0A",
"str_space": " ", "str_space": "%20",
"str_tab": " ", "str_tab": "%20",
"table_tab": "", "table_tab": "",
"font_green": "", "font_green": "",
"font_red": "", "font_red": "",
@@ -18,9 +18,10 @@
"font_purple": "", "font_purple": "",
"font_end": "", "font_end": "",
"font_end2": "", "font_end2": "",
"percentsym": "", "percentsym": "25",
"boldstar": "", "boldstar": "",
"type": "type":
{ {
"bark_text": "\"${bark_srv}/${bark_token}/${1}/${nowtime}${str_linefeed}${2}?group=${device_name}\""
} }
} }

View File

@@ -19,7 +19,7 @@
"font_end": "</font>", "font_end": "</font>",
"font_end2": "", "font_end2": "",
"percentsym": "", "percentsym": "",
"boldstar": "**", "boldstar": "",
"type": "type":
{ {
"token": "\"${pp_token}\"", "token": "\"${pp_token}\"",

View File

@@ -44,9 +44,9 @@ function read_config(){
[ -z "$up_timeout" ] || [ "$up_timeout" -eq "0" ] && up_timeout="2" [ -z "$up_timeout" ] || [ "$up_timeout" -eq "0" ] && up_timeout="2"
[ -z "$down_timeout" ] || [ "$down_timeout" -eq "0" ] && down_timeout="20";down_timeout=`expr ${down_timeout} / 2 + 1` [ -z "$down_timeout" ] || [ "$down_timeout" -eq "0" ] && down_timeout="20";down_timeout=`expr ${down_timeout} / 2 + 1`
[ -z "$timeout_retry_count" ] && timeout_retry_count="2";[ "$timeout_retry_count" -eq "0" ] && timeout_retry_count="1" [ -z "$timeout_retry_count" ] && timeout_retry_count="2";[ "$timeout_retry_count" -eq "0" ] && timeout_retry_count="1"
[ -z "$bark_srv" ] && bark_srv="https://api.day.app" [ ! -z "$bark_token" ] && [ -z "$bark_srv" ] && bark_srv="https://api.day.app"
# String Map # 字符串读取
str_title_start=`/usr/bin/jq -r '.str_title_start' ${jsonpath}` str_title_start=`/usr/bin/jq -r '.str_title_start' ${jsonpath}`
str_title_end=`/usr/bin/jq -r '.str_title_end' ${jsonpath}` str_title_end=`/usr/bin/jq -r '.str_title_end' ${jsonpath}`
str_linefeed=`/usr/bin/jq -r '.str_linefeed' ${jsonpath}` str_linefeed=`/usr/bin/jq -r '.str_linefeed' ${jsonpath}`
@@ -77,6 +77,9 @@ function pushbot_init(){
fi fi
down_oui & down_oui &
deltemp deltemp
get_syslog
add_ip_black
rm -f ${dir}fd1 ${dir}sheep_usage ${dir}old_sheep_usage ${dir}client_usage_aliases ${dir}old_client_usage_aliases /usr/bin/pushbot/errlog >/dev/null 2>&1 rm -f ${dir}fd1 ${dir}sheep_usage ${dir}old_sheep_usage ${dir}client_usage_aliases ${dir}old_client_usage_aliases /usr/bin/pushbot/errlog >/dev/null 2>&1
[ ! -f "/usr/sbin/wrtbwmon" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】未安装 wrtbwmon ,流量统计不可用" >> ${logfile} [ ! -f "/usr/sbin/wrtbwmon" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】未安装 wrtbwmon ,流量统计不可用" >> ${logfile}
[ -z "$ip_version" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】无法获取依赖项 iputils-arping 版本号,请确认插件是否正常运行" >> ${logfile} [ -z "$ip_version" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】无法获取依赖项 iputils-arping 版本号,请确认插件是否正常运行" >> ${logfile}
@@ -99,7 +102,11 @@ function diy_send(){
[ $logrow -eq "0" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【】json 文件生成失败,请检查文件格式" >> ${logfile} && return 1 [ $logrow -eq "0" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【】json 文件生成失败,请检查文件格式" >> ${logfile} && return 1
/usr/bin/jq -r '.[]' ${tempjsonpath}|grep "null" && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】参数变量生成失败,请检查设置项 `/usr/bin/jq -r '.' ${tempjsonpath}|grep "null"`" >> ${logfile} /usr/bin/jq -r '.[]' ${tempjsonpath}|grep "null" && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】参数变量生成失败,请检查设置项 `/usr/bin/jq -r '.' ${tempjsonpath}|grep "null"`" >> ${logfile}
if [ ! -z "$bark_token" ]; then
local bark_text=`/usr/bin/jq -r '.bark_text' ${tempjsonpath}` && local bark_text=`echo $bark_text|sed 's/ /%20/g'` && curl -s $bark_text
else
curl -X POST -H "$content_type" -d "${data}" "${diyurl}" curl -X POST -H "$content_type" -d "${data}" "${diyurl}"
fi
} }
# 下载设备MAC厂商信息 # 下载设备MAC厂商信息
@@ -483,7 +490,7 @@ function LockFile(){
LockFile lock LockFile lock
fi fi
[ $1 = "unlock" ] && rm -f ${dir}pushbot.lock >/dev/null 2>&1 [ $1 = "unlock" ] && rm -f ${dir}pushbot.lock >/dev/null 2>&1
return return 0
} }
# 检测黑白名单 # 检测黑白名单
@@ -752,6 +759,7 @@ function ip_changes(){
function up(){ function up(){
[ -f ${dir}ipAddress ] && ( cat ${dir}ipAddress|grep -q -w $1 ) && return [ -f ${dir}ipAddress ] && ( cat ${dir}ipAddress|grep -q -w $1 ) && return
local ip_mac=`getmac $1` local ip_mac=`getmac $1`
local ip_name=`getname ${1} ${ip_mac}`
local ip_interface=`getinterface ${ip_mac}` local ip_interface=`getinterface ${ip_mac}`
getping ${1} ${up_timeout} "1";local ping_online=$? getping ${1} ${up_timeout} "1";local ping_online=$?
if [ "$ping_online" -eq "0" ]; then if [ "$ping_online" -eq "0" ]; then
@@ -858,6 +866,7 @@ function down_send(){
# 当前设备列表 # 当前设备列表
function current_device(){ function current_device(){
( echo "$lite_enable"|grep -q "content" ) || ( echo "$lite_enable"|grep -q "device" ) && return
[ -f ${dir}ipAddress ] && local logrow=$(grep -c "" ${dir}ipAddress) || local logrow="0";[ $logrow -eq "0" ] && return [ -f ${dir}ipAddress ] && local logrow=$(grep -c "" ${dir}ipAddress) || local logrow="0";[ $logrow -eq "0" ] && return
[ -f ${dir}usage.db ] && local ip_total_db="总计流量${str_space}${str_space}${str_space}${str_space}" [ -f ${dir}usage.db ] && local ip_total_db="总计流量${str_space}${str_space}${str_space}${str_space}"
content="${content}${str_splitline}${str_title_start}${font_blue} 现有在线设备 ${logrow} 台,具体如下${font_end}${str_title_end}${str_linefeed}${str_tab}IP 地址${str_space}${str_space}${str_space}${str_space}${str_space}${str_space}${str_space}${str_space}${str_space}${ip_total_db}${boldstar}客户端名${boldstar}" content="${content}${str_splitline}${str_title_start}${font_blue} 现有在线设备 ${logrow} 台,具体如下${font_end}${str_title_end}${str_linefeed}${str_tab}IP 地址${str_space}${str_space}${str_space}${str_space}${str_space}${str_space}${str_space}${str_space}${str_space}${ip_total_db}${boldstar}客户端名${boldstar}"
@@ -880,7 +889,7 @@ function current_device(){
local ip_total="${ip_total}${str_space}" local ip_total="${ip_total}${str_space}"
done done
fi fi
content="${content}${str_linefeed}${str_tab}${ip}${ip_total}${boldstar}${font_green}${ip_name}${font_end}${boldstar}" content="${content}${str_linefeed}${str_tab}${ip}${ip_total}${boldstar}${font_green}${ip_name}${font_end2}${boldstar}"
unset i n ip_total ip_mac ip_name unset i n ip_total ip_mac ip_name
done done
} }
@@ -965,7 +974,7 @@ EOF
rm -f ${dir}get_syslog >/dev/null 2>&1 rm -f ${dir}get_syslog >/dev/null 2>&1
} }
# 登提醒通知 # 登提醒通知
function login_send(){ function login_send(){
[ -z "$web_logged" ] && [ -z "$ssh_logged" ] && [ -z "$web_login_failed" ] && [ -z "$ssh_login_failed" ] && return [ -z "$web_logged" ] && [ -z "$ssh_logged" ] && [ -z "$web_login_failed" ] && [ -z "$ssh_login_failed" ] && return
[ ! -f ${dir}login_monitor ] && return [ ! -f ${dir}login_monitor ] && return
@@ -984,17 +993,17 @@ function login_send(){
local web_login_mode=`cat ${dir}web_login|grep -w ${login_ip}|awk '{print $3}'|grep -v "^$"|sort -u|head -n1` local web_login_mode=`cat ${dir}web_login|grep -w ${login_ip}|awk '{print $3}'|grep -v "^$"|sort -u|head -n1`
if [ ! -z "$web_logged" ] && [ "$web_logged" -eq "1" ]; then if [ ! -z "$web_logged" ] && [ "$web_logged" -eq "1" ]; then
if [ -z "$title" ]; then if [ -z "$title" ]; then
title="${login_ip} 通过 web 登了路由器" title="${login_ip} 通过 Web 登了路由器"
content="${content}${str_splitline}${str_title_start} 登信息${str_title_end}${str_linefeed}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${web_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}" content="${content}${str_splitline}${str_title_start}${font_green}信息${font_end}${str_title_end}${str_linefeed}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${web_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}"
elif ( echo "$title"|grep -q "登了路由器" ); then elif ( echo "$title"|grep -q "登了路由器" ); then
title="${login_ip} ${title}" title="${login_ip} ${title}"
content="${content}${str_splitline}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${web_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}" content="${content}${str_splitline}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${web_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}"
else else
title="设备状态变化" title="设备状态变化"
content="${content}${str_splitline}${str_title_start} 登信息${str_title_end}${str_linefeed}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${web_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}" content="${content}${str_splitline}${str_title_start}${font_green}信息${font_end}${str_title_end}${str_linefeed}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${web_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}"
fi fi
fi fi
echo "`date "+%Y-%m-%d %H:%M:%S"` ${disturb_text}设备 ${login_ip} 通过 web ${web_login_mode} 登了路由器 " >> ${logfile} echo "`date "+%Y-%m-%d %H:%M:%S"` ${disturb_text}设备 ${login_ip} 通过 web ${web_login_mode} 登了路由器 " >> ${logfile}
done done
echo "" > ${dir}web_login echo "" > ${dir}web_login
unset login_ip login_ip_list unset login_ip login_ip_list
@@ -1008,17 +1017,17 @@ function login_send(){
[ ! -z "$ssh_login_mode" ] && local content_mode="${str_linefeed}${str_tab}登录方式: ${str_space}${str_space}${str_space}${str_space}${ssh_login_mode}" [ ! -z "$ssh_login_mode" ] && local content_mode="${str_linefeed}${str_tab}登录方式: ${str_space}${str_space}${str_space}${str_space}${ssh_login_mode}"
if [ ! -z "$ssh_logged" ] && [ "$ssh_logged" -eq "1" ]; then if [ ! -z "$ssh_logged" ] && [ "$ssh_logged" -eq "1" ]; then
if [ -z "$title" ]; then if [ -z "$title" ]; then
title="${login_ip} 通过 ssh了路由器" title="${login_ip} 通过 SSH了路由器"
content="${content}${str_splitline}${str_title_start} 登信息${str_title_end}${str_linefeed}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${ssh_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}" content="${content}${str_splitline}${str_title_start}${font_green}信息${font_end}${str_title_end}${str_linefeed}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${ssh_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}"
elif ( echo "$title"|grep -q "登了路由器" ); then elif ( echo "$title"|grep -q "登了路由器" ); then
title="${login_ip} ${title}" title="${login_ip} ${title}"
content="${content}${str_splitline}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${ssh_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}" content="${content}${str_splitline}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${ssh_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}"
else else
title="设备状态变化" title="设备状态变化"
content="${content}${str_splitline}${str_title_start} 登信息${str_title_end}${str_linefeed}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${ssh_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}" content="${content}${str_splitline}${str_title_start}${font_green}信息${str_title_end}${str_linefeed}${str_tab}时间:${str_space}${str_space}${str_space}${str_space}${str_space}${ssh_login_time}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}${content_mode}"
fi fi
fi fi
echo "`date "+%Y-%m-%d %H:%M:%S"` 【info】设备 ${login_ip} 通过 ssh ${ssh_login_mode} 登了路由器 " >> ${logfile} echo "`date "+%Y-%m-%d %H:%M:%S"` 【info】设备 ${login_ip} 通过 SSH ${ssh_login_mode} 登了路由器 " >> ${logfile}
done done
echo "" > ${dir}ssh_login echo "" > ${dir}ssh_login
unset login_ip login_ip_list unset login_ip login_ip_list
@@ -1031,18 +1040,18 @@ function login_send(){
if [ "$web_login_sum" -ge "$login_max_num" ] ;then if [ "$web_login_sum" -ge "$login_max_num" ] ;then
if [ ! -z "$web_login_failed" ] && [ "$web_login_failed" -eq "1" ]; then if [ ! -z "$web_login_failed" ] && [ "$web_login_failed" -eq "1" ]; then
if [ -z "$title" ]; then if [ -z "$title" ]; then
title="${login_ip} 通过 web 频繁尝试登" title="${login_ip} 通过 Web 频繁尝试登"
content="${content}${str_splitline}${str_title_start} 登信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}" content="${content}${str_splitline}${str_title_start}${font_red}信息${font_end}${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
elif ( echo "$title"|grep -q "频繁尝试登" ); then elif ( echo "$title"|grep -q "频繁尝试登" ); then
title="${login_ip} ${title}" title="${login_ip} ${title}"
content="${content}${str_splitline}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}" content="${content}${str_splitline}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
else else
title="设备状态变化" title="设备状态变化"
content="${content}${str_splitline}${str_title_start} 登信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}" content="${content}${str_splitline}${str_title_start}${font_red}信息${font_end}${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
fi fi
fi fi
sed -i "/^${login_ip}$/d" ${dir}web_failed sed -i "/^${login_ip}$/d" ${dir}web_failed
echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】设备 ${login_ip} 通过 web 频繁尝试登" >> ${logfile} echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】设备 ${login_ip} 通过 Web 频繁尝试登" >> ${logfile}
add_ip_black $login_ip add_ip_black $login_ip
fi fi
done done
@@ -1056,18 +1065,18 @@ function login_send(){
if [ "$ssh_login_sum" -ge "$login_max_num" ] ;then if [ "$ssh_login_sum" -ge "$login_max_num" ] ;then
if [ ! -z "$ssh_login_failed" ] && [ "$ssh_login_failed" -eq "1" ]; then if [ ! -z "$ssh_login_failed" ] && [ "$ssh_login_failed" -eq "1" ]; then
if [ -z "$title" ]; then if [ -z "$title" ]; then
title="${login_ip} 通过 ssh 频繁尝试登" title="${login_ip} 通过 SSH 频繁尝试登"
content="${content}${str_splitline}${str_title_start} 登信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}" content="${content}${str_splitline}${str_title_start}${font_red}信息${font_end}${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
elif ( echo "$title"|grep -q "频繁尝试登" ); then elif ( echo "$title"|grep -q "频繁尝试登" ); then
title="${login_ip} ${title}" title="${login_ip} ${title}"
content="${content}${str_splitline}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}" content="${content}${str_splitline}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
else else
title="设备状态变化" title="设备状态变化"
content="${content}${str_splitline}${str_title_start} 登信息${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}" content="${content}${str_splitline}${str_title_start}${font_red}信息${font_end}${str_title_end}${str_linefeed}${str_tab}设备 IP ${str_space}${str_space}${str_space}${str_space}${login_ip}"
fi fi
fi fi
sed -i "/^${login_ip}$/d" ${dir}ssh_failed sed -i "/^${login_ip}$/d" ${dir}ssh_failed
echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】设备 ${login_ip} 通过 ssh 频繁尝试登" >> ${logfile} echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】设备 ${login_ip} 通过 SSH 频繁尝试登" >> ${logfile}
add_ip_black $login_ip add_ip_black $login_ip
fi fi
done done
@@ -1102,7 +1111,7 @@ function add_ip_black(){
function send(){ function send(){
echo "`date "+%Y-%m-%d %H:%M:%S"` 【定时数据】创建定时任务" >> ${logfile} echo "`date "+%Y-%m-%d %H:%M:%S"` 【定时数据】创建定时任务" >> ${logfile}
pushbot_disturb;local send_disturb=$? pushbot_disturb;local send_disturb=$?
get_config "send_title" "router_status" "client_list" "router_temp" "router_wan" get_config "send_title" "router_status" "router_temp" "router_wan" "client_list"
[ -z "$send_title" ] && local send_title="路由状态:" [ -z "$send_title" ] && local send_title="路由状态:"
[ ! -z "$1" ] && local send_title="发送测试:" && local send_content="${str_splitline}${str_title_start}内容1${str_title_end}${str_linefeed}${str_tab}设备1${str_linefeed}${str_tab}设备2${str_splitline}${str_title_start}内容2${str_title_end}${str_linefeed}${str_tab}设备3${str_linefeed}${str_tab}设备4" [ ! -z "$1" ] && local send_title="发送测试:" && local send_content="${str_splitline}${str_title_start}内容1${str_title_end}${str_linefeed}${str_tab}设备1${str_linefeed}${str_tab}设备2${str_splitline}${str_title_start}内容2${str_title_end}${str_linefeed}${str_tab}设备3${str_linefeed}${str_tab}设备4"
@@ -1240,10 +1249,10 @@ while [ "$pushbot_enable" -eq "1" ]; do
# 异常流量检测 # 异常流量检测
[ ! -f "${dir}send_enable.lock" ] && get_client_usage [ ! -f "${dir}send_enable.lock" ] && get_client_usage
# 登提醒通知 # 登提醒通知
[ ! -f "${dir}send_enable.lock" ] && login_send [ ! -f "${dir}send_enable.lock" ] && login_send
# Noti # 通知
if [ ! -f "${dir}send_enable.lock" ] && [ ! -z "$title" ] && [ ! -z "$content" ]; then if [ ! -f "${dir}send_enable.lock" ] && [ ! -z "$title" ] && [ ! -z "$content" ]; then
[ ! -z "$device_name" ] && title="【$device_name】$title" [ ! -z "$device_name" ] && title="【$device_name】$title"
( echo "$lite_enable"|grep -q "content" ) && content="$title" ( echo "$lite_enable"|grep -q "content" ) && content="$title"