Skip to content

Commit

Permalink
v3.5.3
Browse files Browse the repository at this point in the history
1. 修复并发时文件锁失效的 bug
2. 修复带参数启动时,线程限制没有生效的 bug
3. 修复 MAC 信息表下载不成功,且日志无提示的问题
4. 优化和修复主机名等信息的获取未按预期工作的问题
5. 修复部分版本的系统,SSH登录信息获取不正确的问题
6. 局域网扫描应快速扫描更新 ARP 列表,而不是加入 IPLIST 列表,使用普通的 ping 超时检测
7. 减少一部分调试模式中的信息输出,方便排查错误
8. 稍稍调整了推送内容中,设备列表的对齐方式
9. 增加通过 NetBIOS 查询主机名和 MAC 的方式,此功能需要安装 samba*-server 或 samba*-client
10. 因 OpenWrt 版本的 jq 处理速度已经有了显著提升,改为使用 json 存储 IP 和设备信息
11. 清理多余代码和一些小的修改
  • Loading branch information
tty228 committed Jul 7, 2024
1 parent 2cb9278 commit bc20fbc
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 73 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-wechatpush
PKG_VERSION:=3.5.1
PKG_VERSION:=3.5.3
PKG_RELEASE:=

PKG_MAINTAINER:=tty228 <[email protected]>
Expand Down
2 changes: 0 additions & 2 deletions root/etc/uci-defaults/luci-wechatpush
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh

dir="/tmp/wechatpush/" && mkdir -p ${dir} && mkdir -p ${dir}/client
rm -f ${dir}client/* >/dev/null 2>&1
rm -rf /tmp/luci-* >/dev/null 2>&1
12 changes: 6 additions & 6 deletions root/usr/libexec/wechatpush-call
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

logfile="/tmp/wechatpush/wechatpush.log"
dir="/tmp/wechatpush/" && mkdir -p "${dir}"
oui_base="${dir}oui_base.txt"
dir="/tmp/wechatpush" && mkdir -p "${dir}"
oui_base="${dir}/oui_base.txt"
oui_data=$(uci get wechatpush.config.oui_data 2>/dev/null)
oui_url="https://standards-oui.ieee.org/oui/oui.txt"

Expand All @@ -18,16 +18,16 @@ file_date() {
down_oui() {
if [ -n "${oui_data}" ] && [ "${oui_data}" -ne "3" ]; then
echo "$(date "+%Y-%m-%d %H:%M:%S") 【info】开始后台更新 MAC 信息文件" >>"${logfile}"
curl -fsSL --connect-timeout 15 --max-time 30 -o "${dir}oui.txt" "${oui_url}" >/dev/null 2>&1
curl -fsSL --connect-timeout 15 --max-time 30 -o "${dir}/oui.txt" "${oui_url}" >/dev/null 2>&1
local RETVAL=$?
[ ${RETVAL} -ne 0 ] && echo "$(date "+%Y-%m-%d %H:%M:%S") 【!!!】设备 MAC 信息文件下载失败,返回码为 ${RETVAL}" >>"${logfile}" && return 1
echo "$(date "+%Y-%m-%d %H:%M:%S") 【info】设备 MAC 信息文件下载成功,处理中" >>"${logfile}"
if [ "${oui_data}" -eq "1" ]; then
grep -i -E ".*(base 16).*(apple|aruba|asus|autelan|belkin|bhu|buffalo|cctf|cisco|comba|datang|dell|dlink|dowell|ericsson|fast|feixun|fiberhome|fujitsu|grentech|h3c|hisense|hiwifi|honghai|honghao|hp|htc|huawei|intel|jinli|jse|lenovo|lg|liteon|malata|meizu|mercury|meru|moto|netcore|netgear|nokia|omron|oneplus|oppo|philips|router_unkown|samsung|shanzhai|sony|start_net|sunyuanda|tcl|tenda|texas|tianyu|tp-link|ubq|undefine|VMware|utstarcom|volans|xerox|xiaomi|zdc|zhongxing|smartisan).*" "${dir}oui.txt" | sed -E 's/( Electronic| Technology| Intelligence| TECHNOLOGIES| Device| Systems| TELECOMMUNICATIONS| Instruments| Electronics| Corporation| Telecommunication| Communications| Electrical| Technology| Corporate| Intelligent| Interactive| MOBILE| Solutions| Mobility| Meraki| ELECTRO| VISUAL| Limited| International| Information| LLC|Co$|Co\.|Ltd\.$|Inc\.|B\.V\.$|AB$|,).*$/ /I; s/[[:space:]]*$//; s/ +$//' >"${oui_base}"
grep -i -E ".*(base 16).*(apple|aruba|asus|autelan|belkin|bhu|buffalo|cctf|cisco|comba|datang|dell|dlink|dowell|ericsson|fast|feixun|fiberhome|fujitsu|grentech|h3c|hisense|hiwifi|honghai|honghao|hp|htc|huawei|intel|jinli|jse|lenovo|lg|liteon|malata|meizu|mercury|meru|moto|netcore|netgear|nokia|omron|oneplus|oppo|philips|router_unkown|samsung|shanzhai|sony|start_net|sunyuanda|tcl|tenda|texas|tianyu|tp-link|ubq|undefine|VMware|utstarcom|volans|xerox|xiaomi|zdc|zhongxing|smartisan).*" "${dir}/oui.txt" | sed -E 's/( Electronic| Technology| Intelligence| TECHNOLOGIES| Device| Systems| TELECOMMUNICATIONS| Instruments| Electronics| Corporation| Telecommunication| Communications| Electrical| Technology| Corporate| Intelligent| Interactive| MOBILE| Solutions| Mobility| Meraki| ELECTRO| VISUAL| Limited| International| Information| LLC|Co$|Co\.|Ltd\.$|Inc\.|B\.V\.$|AB$|,).*$/ /I; s/[[:space:]]*$//; s/ +$//' >"${oui_base}"
elif [ "${oui_data}" -eq "2" ]; then
grep -i "(base 16)" "${dir}oui.txt" | sed -E 's/( Electronic| Technology| Intelligence| TECHNOLOGIES| Device| Systems| TELECOMMUNICATIONS| Instruments| Electronics| Corporation| Telecommunication| Communications| Electrical| Technology| Corporate| Intelligent| Interactive| MOBILE| Solutions| Mobility| Meraki| ELECTRO| VISUAL| Limited| International| Information| LLC|Co$|Co\.|Ltd\.$|Inc\.|B\.V\.$|AB$|,).*$/ /I; s/[[:space:]]*$//; s/ +$//' >"${oui_base}"
grep -i "(base 16)" "${dir}/oui.txt" | sed -E 's/( Electronic| Technology| Intelligence| TECHNOLOGIES| Device| Systems| TELECOMMUNICATIONS| Instruments| Electronics| Corporation| Telecommunication| Communications| Electrical| Technology| Corporate| Intelligent| Interactive| MOBILE| Solutions| Mobility| Meraki| ELECTRO| VISUAL| Limited| International| Information| LLC|Co$|Co\.|Ltd\.$|Inc\.|B\.V\.$|AB$|,).*$/ /I; s/[[:space:]]*$//; s/ +$//' >"${oui_base}"
fi
rm -f "${dir}oui.txt" >/dev/null 2>&1
rm -f "${dir}/oui.txt" >/dev/null 2>&1
echo "$(date "+%Y-%m-%d %H:%M:%S") 【info】设备 MAC 信息文件处理完成" >>"${logfile}"
fi
}
Expand Down
Loading

0 comments on commit bc20fbc

Please sign in to comment.