推送信息中客户端名称错误
您使用的版本? | Your usage version?
v3.6.8
您使用的场景? | Your usage scenarios?
iStoreOS 中推送设备上线下线信息
您遇到了什么问题? | What are your problems?
推送正常,但是经常会出现一些莫名其妙的客户端名称,类似下面这种
新设备连接
- 客户端名: bin boot dev etc ext_overlay lib lib64 mnt notice opt overlay proc rom root run sbin sys tmp usr var www
- 客户端IP: 192.168.100.133
- 客户端MAC: 76:6a:60:e1:17:a0
- 网络接口: br-lan
新设备连接
- 客户端名: bin boot dev etc ext_overlay lib lib64 mnt notice opt overlay proc rom root run sbin sys tmp usr var www
- 客户端IP: 192.168.100.182
- 客户端MAC: 66:a5:fd:d3:93:22
- 网络接口: br-lan
您期望的结果是怎样的? | What is your expected outcome?
不知道是bug还是我这边设备的问题,当然是能修复最好,谢谢大佬^_^
请提供日志 但看着像是 bash 的问题,尝试安装/更新一下 bash
2025-04-12 08:42:59 【gotify】 新设备 heng-de-S24-Ultra 192.168.100.147 连接了
2025-04-12 08:45:01 【gotify】 新设备 bin boot dev etc ext_overlay lib lib64 mnt notice opt overlay proc rom root run sbin sys tmp usr var www 192.168.100.211 连接了
2025-04-12 08:47:21 【gotify】 设备 192.168.100.147 (本地局域网) 通过 Web for 登录了路由器
2025-04-12 08:48:59 【gotify】 新设备 bin boot dev etc ext_overlay lib lib64 mnt notice opt overlay proc rom root run sbin sys tmp usr var www 192.168.100.182 连接了
2025-04-12 08:51:20 【gotify】 设备 bin boot dev etc ext.. 192.168.100.211 断开连接
2025-04-12 08:55:25 【gotify】 新设备 bin boot dev etc ext_overlay lib lib64 mnt notice opt overlay proc rom root run sbin sys tmp usr var www 192.168.100.211 连接了
2025-04-12 09:03:57 【gotify】 设备 heng-de-S24-Ultra 192.168.100.147 断开连接
2025-04-12 09:03:58 【gotify】 设备 bin boot dev etc ext.. 192.168.100.182 断开连接
2025-04-12 09:06:53 【gotify】 新设备 heng-de-S24-Ultra 192.168.100.147 连接了
2025-04-12 10:24:53 [ALERT] CPU 占用前三: /usr/bin/dockerd 23% ./sun-panel 9% /usr/bin/docker-proxy 4%
2025-04-12 10:29:12 【gotify】 设备 172.17.0.6 (IANA) 通过 SSH Pubkey 登录了路由器
2025-04-12 10:42:10 【gotify】 新设备 bin boot dev etc ext_overlay lib lib64 mnt notice opt overlay proc rom root run sbin sys tmp usr var www 192.168.100.211 连接了
2025-04-12 10:42:42 [ALERT] CPU load too high: 4.93
2025-04-12 10:42:43 [ALERT] CPU 占用前三: /usr/lib/jellyfin-ffmpeg/ffmpeg 23% docker 13% /jellyfin/jellyfin
2025-04-12 10:43:57 【gotify】 设备 192.168.100.211 (本地局域网) 通过 Web for 登录了路由器
大概能看到的日志就是这样的,其中大部分设备都是正常的,只是个别设备有那种情况,我也排查不出是什么设备,设备上的bash版本是:5.2.15-1
还有一个问题 ${2} 这个变量,在推送设备负载的时候 推送的还是设备列表,不知道这个是啥问题。
+ for ip in $IPLIST
+ + '[' -n up '' 192.168.100.171']'
+ read -u 5
+ local ip=192.168.100.171
+ '[' -z 192.168.100.171 ']'
+ jq -e --arg ip 192.168.100.171 '.devices[] | select(.ip == $ip and .status == "online") | .ip' /tmp/wechatpush/devices.json
++ getmac 192.168.100.171
++ local ip=192.168.100.171
++ local mac
++ '[' -z 192.168.100.171 ']'
+++ jq -r --arg ip 192.168.100.171 '.devices[] | select(.ip == $ip) | .mac' /tmp/wechatpush/devices.json
++ mac=ae:01:c1:ff:14:b0
+++ jq -r --arg mac ae:01:c1:ff:14:b0 '.devices[] | select((.mac | ascii_downcase) == ($mac | ascii_downcase)) | .mac' /tmp/wechatpush/devices.json
+++ wc -l
++ local mac_count=1
++ '[' 1 -eq 1 ']'
++ process_and_check ae:01:c1:ff:14:b0
++ '[' -z ae:01:c1:ff:14:b0 ']'
+++ echo ae:01:c1:ff:14:b0
+++ tr -d '\n\r'
+++ awk '$1=$1'
+++ sed 's/_/ /g'
+++ grep -v '^$'
+++ head -n1+++ sort -u
++ local value=ae:01:c1:ff:14:b0
++ '[' ae:01:c1:ff:14:b0 == unknown ']'
++ '[' -n ae:01:c1:ff:14:b0 ']'
++ '[' -n '' ']'
++ '[' -n ae:01:c1:ff:14:b0 ']'
++ echo ae:01:c1:ff:14:b0
++ return 0
++ return
+ local mac=ae:01:c1:ff:14:b0
+ getping 192.168.100.171 ae:01:c1:ff:14:b0 2 1
+ local ip=192.168.100.171
+ local mac=ae:01:c1:ff:14:b0
+ local timeout=2
+ local retry_count=1
++ getinterface ip ae:01:c1:ff:14:b0
++ local ip=ip
++ local mac=ae:01:c1:ff:14:b0
++ local interface
++ '[' -z ae:01:c1:ff:14:b0 ']'
++ '[' ae:01:c1:ff:14:b0 == unknown ']'
+++ jq -r --arg ip ip --arg mac ae:01:c1:ff:14:b0 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .interface' /tmp/wechatpush/devices.json
++ interface=
++ process_and_check ''
++ '[' -z '' ']'
++ return 1
++ '[' -n '' ']'
+++ cat /proc/net/arp
+++ grep '0x2\|0x6'
+++ grep -v '^169.254.'
+++ grep -i -w ae:01:c1:ff:14:b0
+++ awk '{print $6}'
+++ sort -u+++ grep -v '^$'
大佬,这是相关日志,171这个ip就是显示 bin boot dev etc ext_overlay lib lib64 mnt notice opt overlay proc rom root run sbin sys tmp usr var www 这种
++ return
+ local interface=br-lan
+ jq -e --arg ip 192.168.100.182 --arg mac 66:a5:fd:d3:93:22 --arg name 'bin boot dev etc ext..' --arg interface br-lan '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase) and .name == $name and .interface == $interface) | .ip' /tmp/wechatpush/devices.json
+ '[' -f /tmp/wechatpush/openwrt_info ']'
+ '[' -f /tmp/wechatpush/miwifi_info ']'
+ '[' -f /tmp/wechatpush/gateway_info ']'
+ '[' -n '' ']'
+ silent_run LockFile unlock
+ LockFile unlock
+ echo
+ for ip in $IPLIST
+ + '[' -n down '' 192.168.100.214']'
++ return 1
++ '[' -f /tmp/wechatpush/gateway_info ']'
++ '[' -f /tmp/wechatpush/mikrotik_info ']'
++ '[' -f /tmp/wechatpush/miwifi_info ']'
++ '[' -f /tmp/wechatpush/openwrt_info ']'
+++ jq -r --arg ip 192.168.100.182 --arg mac 66:a5:fd:d3:93:22 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .name' /tmp/wechatpush/devices.json
++ tmp_name='bin boot dev etc ext..'
++ '[' -n '' ']'
++ process_and_check 'bin boot dev etc ext..' 20
++ '[' -z 'bin boot dev etc ext..' ']'
+++ echo 'bin boot dev etc ext..'
+++ tr -d '\n\r'
+++ awk '$1=$1'
+++ sed 's/_/ /g'
+++ +++ sort head +++ -u
-n1grep
-v '^$'
++ local 'value=bin boot dev etc ext..'
++ '[' 'bin boot dev etc ext..' == unknown ']'
++ '[' -n 'bin boot dev etc ext..' ']'
++ '[' -n 20 ']'
+++ cut_str 'bin boot dev etc ext..' 20
+++ '[' -z 'bin boot dev etc ext..' ']'
+++ '[' -z 20 ']'
+++ local result
+++ echo 'bin boot dev etc ext..'
++ echo bin boot dev etc ext..
++ return 0
++ return
+ local 'name=bin boot dev etc ext..'
++ getinterface ip 66:a5:fd:d3:93:22
++ local ip=ip
++ local mac=66:a5:fd:d3:93:22
++ local interface
++ '[' -z 66:a5:fd:d3:93:22 ']'
++ '[' 66:a5:fd:d3:93:22 == unknown ']'
+++ jq -r --arg ip ip --arg mac 66:a5:fd:d3:93:22 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .interface' /tmp/wechatpush/devices.json
++ interface=
++ process_and_check ''
++ '[' -z '' ']'
主要是这段吧 bin boot dev etc ext.. 相关的
也不对,感觉是没有名字的就会显示成这样
确实,没有获取到名字的设备就显示成这个了
++ return + local interface=br-lan + jq -e --arg ip 192.168.100.182 --arg mac 66:a5:fd:d3:93:22 --arg name 'bin boot dev etc ext..' --arg interface br-lan '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase) and .name == $name and .interface == $interface) | .ip' /tmp/wechatpush/devices.json + '[' -f /tmp/wechatpush/openwrt_info ']' + '[' -f /tmp/wechatpush/miwifi_info ']' + '[' -f /tmp/wechatpush/gateway_info ']' + '[' -n '' ']' + silent_run LockFile unlock + LockFile unlock + echo + for ip in $IPLIST + + '[' -n down '' 192.168.100.214']'++ return 1 ++ '[' -f /tmp/wechatpush/gateway_info ']' ++ '[' -f /tmp/wechatpush/mikrotik_info ']' ++ '[' -f /tmp/wechatpush/miwifi_info ']' ++ '[' -f /tmp/wechatpush/openwrt_info ']' +++ jq -r --arg ip 192.168.100.182 --arg mac 66:a5:fd:d3:93:22 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .name' /tmp/wechatpush/devices.json ++ tmp_name='bin boot dev etc ext..' ++ '[' -n '' ']' ++ process_and_check 'bin boot dev etc ext..' 20 ++ '[' -z 'bin boot dev etc ext..' ']' +++ echo 'bin boot dev etc ext..' +++ tr -d '\n\r' +++ awk '$1=$1' +++ sed 's/_/ /g' +++ +++ sort head +++ -u -n1grep -v '^$' ++ local 'value=bin boot dev etc ext..' ++ '[' 'bin boot dev etc ext..' == unknown ']' ++ '[' -n 'bin boot dev etc ext..' ']' ++ '[' -n 20 ']' +++ cut_str 'bin boot dev etc ext..' 20 +++ '[' -z 'bin boot dev etc ext..' ']' +++ '[' -z 20 ']' +++ local result +++ echo 'bin boot dev etc ext..' ++ echo bin boot dev etc ext.. ++ return 0 ++ return + local 'name=bin boot dev etc ext..' ++ getinterface ip 66:a5:fd:d3:93:22 ++ local ip=ip ++ local mac=66:a5:fd:d3:93:22 ++ local interface ++ '[' -z 66:a5:fd:d3:93:22 ']' ++ '[' 66:a5:fd:d3:93:22 == unknown ']' +++ jq -r --arg ip ip --arg mac 66:a5:fd:d3:93:22 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .interface' /tmp/wechatpush/devices.json ++ interface= ++ process_and_check '' ++ '[' -z '' ']'主要是这段吧 bin boot dev etc ext.. 相关的
这段是从 /tmp/wechatpush/devices.json 中读取已经保存的设备名,要定位的话,需要清空这个文件再运行,才能知道问题在哪
还有一个问题 ${2} 这个变量,在推送设备负载的时候 推送的还是设备列表,不知道这个是啥问题。
变量不小心设置为 local 了,已修
++ return + local interface=br-lan + jq -e --arg ip 192.168.100.182 --arg mac 66:a5:fd:d3:93:22 --arg name 'bin boot dev etc ext..' --arg interface br-lan '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase) and .name == $name and .interface == $interface) | .ip' /tmp/wechatpush/devices.json + '[' -f /tmp/wechatpush/openwrt_info ']' + '[' -f /tmp/wechatpush/miwifi_info ']' + '[' -f /tmp/wechatpush/gateway_info ']' + '[' -n '' ']' + silent_run LockFile unlock + LockFile unlock + echo + for ip in $IPLIST + + '[' -n down '' 192.168.100.214']'++ return 1 ++ '[' -f /tmp/wechatpush/gateway_info ']' ++ '[' -f /tmp/wechatpush/mikrotik_info ']' ++ '[' -f /tmp/wechatpush/miwifi_info ']' ++ '[' -f /tmp/wechatpush/openwrt_info ']' +++ jq -r --arg ip 192.168.100.182 --arg mac 66:a5:fd:d3:93:22 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .name' /tmp/wechatpush/devices.json ++ tmp_name='bin boot dev etc ext..' ++ '[' -n '' ']' ++ process_and_check 'bin boot dev etc ext..' 20 ++ '[' -z 'bin boot dev etc ext..' ']' +++ echo 'bin boot dev etc ext..' +++ tr -d '\n\r' +++ awk '$1=$1' +++ sed 's/_/ /g' +++ +++ sort head +++ -u -n1grep -v '^$' ++ local 'value=bin boot dev etc ext..' ++ '[' 'bin boot dev etc ext..' == unknown ']' ++ '[' -n 'bin boot dev etc ext..' ']' ++ '[' -n 20 ']' +++ cut_str 'bin boot dev etc ext..' 20 +++ '[' -z 'bin boot dev etc ext..' ']' +++ '[' -z 20 ']' +++ local result +++ echo 'bin boot dev etc ext..' ++ echo bin boot dev etc ext.. ++ return 0 ++ return + local 'name=bin boot dev etc ext..' ++ getinterface ip 66:a5:fd:d3:93:22 ++ local ip=ip ++ local mac=66:a5:fd:d3:93:22 ++ local interface ++ '[' -z 66:a5:fd:d3:93:22 ']' ++ '[' 66:a5:fd:d3:93:22 == unknown ']' +++ jq -r --arg ip ip --arg mac 66:a5:fd:d3:93:22 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .interface' /tmp/wechatpush/devices.json ++ interface= ++ process_and_check '' ++ '[' -z '' ']'主要是这段吧 bin boot dev etc ext.. 相关的
这段是从
/tmp/wechatpush/devices.json中读取已经保存的设备名,要定位的话,需要清空这个文件再运行,才能知道问题在哪
这个文件,目前我只能确定 名称错误的这种设备的信息没有在这个文件中,我已经清空重新运行了,有后续我继续反馈。谢谢大佬
I have the same problem, KWRT Snapshot 24.10. Tried as OP but still occupied error
I have the same problem, KWRT Snapshot 24.10. Tried as OP but still occupied error
Currently, we are unable to pinpoint the cause of this error. If possible, please clear the files in the /tmp/wechatpush/ directory and run bash -x /usr/share/wechatpush/wechatpush t1. Then, capture the segment where the error occurs (if the error can still be reproduced after clearing the temporary files).
another name "child pid content de..." beside "bin dev etc lib lib64..." I have a few wifi switches and zigbee hub so it doesn't have hostname.
+++ jq -r --arg ip 192.168.68.153 '.[] | select(.ip == $ip) | .name' /tmp/wechatpush/miwifi_info ++ tmp_name= ++ process_and_check '' 20 ++ '[' -z '' ']' ++ return 1 ++ '[' -f /tmp/wechatpush/openwrt_info ']' +++ jq -r --arg ip 192.168.68.153 --arg mac 32:c1:75:ca:66:e3 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .name' /tmp/wechatpush/devices.json ++ tmp_name='child pid content de..' ++ '[' -n '' ']' ++ process_and_check 'child pid content de..' 20 ++ '[' -z 'child pid content de..' ']' +++ echo 'child pid content de..' +++ tr -d '\n\r' +++ awk '$1=$1' +++ sed 's/_/ /g' +++ grep -v '^$' +++ sort -u +++ head -n1 ++ local 'value=child pid content de..' ++ '[' 'child pid content de..' == unknown ']' ++ '[' -n 'child pid content de..' ']' ++ '[' -n 20 ']' +++ cut_str 'child pid content de..' 20 +++ '[' -z 'child pid content de..' ']' +++ '[' -z 20 ']' +++ local result +++ echo 'child pid content de..' ++ echo child pid content de.. ++ return 0 ++ return
- local 'name=child pid content de..' ++ getinterface ip 32:c1:75:ca:66:e3 ++ local ip=ip ++ local mac=32:c1:75:ca:66:e3 ++ local interface ++ '[' -z 32:c1:75:ca:66:e3 ']' ++ '[' 32:c1:75:ca:66:e3 == unknown ']' +++ jq -r --arg ip ip --arg mac 32:c1:75:ca:66:e3 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .interface' /tmp/wechatpush/devices.json ++ interface= ++ process_and_check '' ++ '[' -z '' ']' ++ return 1 ++ '[' -n '' ']' +++ cat /proc/net/arp +++ grep '0x2|0x6' +++ grep -v '^169.254.' +++ grep -i -w 32:c1:75:ca:66:e3 +++ awk '{print $6}' +++ grep -v '^$' +++ sort -u ++ interface=br-lan ++ process_and_check br-lan ++ '[' -z br-lan ']' +++ echo br-lan +++ tr -d '\n\r' +++ awk '$1=$1' +++ sed 's/_/ /g' +++ grep -v '^$' +++ sort -u +++ head -n1 ++ local value=br-lan ++ '[' br-lan == unknown ']' ++ '[' -n br-lan ']' ++ '[' -n '' ']' ++ '[' -n br-lan ']' ++ echo br-lan ++ return 0 ++ return
- local interface=br-lan
- jq -e --arg ip 192.168.68.153 --arg mac 32:c1:75:ca:66:e3 --arg name 'child pid content de..' --arg interface br-lan '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase) and .name == $name and .interface == $interface) | .ip' /tmp/wechatpush/devices.json
- '[' -f /tmp/wechatpush/openwrt_info ']'
- '[' -f /tmp/wechatpush/miwifi_info ']'
- '[' -z '' ']' ++ jq -r --arg ip 192.168.68.153 '.[] | select(.ip == $ip) | .type' /tmp/wechatpush/miwifi_info
- local tmp_type= ++ jq -r --arg ip 192.168.68.153 '.[] | select(.ip == $ip) | .parent' /tmp/wechatpush/miwifi_info
- local tmp_parent=
- '[' -f /tmp/wechatpush/gateway_info ']'
- '[' -n '' ']'
another name "child pid content de..." beside "bin dev etc lib lib64..." I have a few wifi switches and zigbee hub so it doesn't have hostname.
+++ jq -r --arg ip 192.168.68.153 '.[] | select(.ip == $ip) | .name' /tmp/wechatpush/miwifi_info ++ tmp_name= ++ process_and_check '' 20 ++ '[' -z '' ']' ++ return 1 ++ '[' -f /tmp/wechatpush/openwrt_info ']' +++ jq -r --arg ip 192.168.68.153 --arg mac 32:c1:75:ca:66:e3 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .name' /tmp/wechatpush/devices.json ++ tmp_name='child pid content de..' ++ '[' -n '' ']' ++ process_and_check 'child pid content de..' 20 ++ '[' -z 'child pid content de..' ']' +++ echo 'child pid content de..' +++ tr -d '\n\r' +++ awk '$1=$1' +++ sed 's/_/ /g' +++ grep -v '^$' +++ sort -u +++ head -n1 ++ local 'value=child pid content de..' ++ '[' 'child pid content de..' == unknown ']' ++ '[' -n 'child pid content de..' ']' ++ '[' -n 20 ']' +++ cut_str 'child pid content de..' 20 +++ '[' -z 'child pid content de..' ']' +++ '[' -z 20 ']' +++ local result +++ echo 'child pid content de..' ++ echo child pid content de.. ++ return 0 ++ return
- local 'name=child pid content de..' ++ getinterface ip 32:c1:75:ca:66:e3 ++ local ip=ip ++ local mac=32:c1:75:ca:66:e3 ++ local interface ++ '[' -z 32:c1:75:ca:66:e3 ']' ++ '[' 32:c1:75:ca:66:e3 == unknown ']' +++ jq -r --arg ip ip --arg mac 32:c1:75:ca:66:e3 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .interface' /tmp/wechatpush/devices.json ++ interface= ++ process_and_check '' ++ '[' -z '' ']' ++ return 1 ++ '[' -n '' ']' +++ cat /proc/net/arp +++ grep '0x2|0x6' +++ grep -v '^169.254.' +++ grep -i -w 32:c1:75:ca:66:e3 +++ awk '{print $6}' +++ grep -v '^$' +++ sort -u ++ interface=br-lan ++ process_and_check br-lan ++ '[' -z br-lan ']' +++ echo br-lan +++ tr -d '\n\r' +++ awk '$1=$1' +++ sed 's/_/ /g' +++ grep -v '^$' +++ sort -u +++ head -n1 ++ local value=br-lan ++ '[' br-lan == unknown ']' ++ '[' -n br-lan ']' ++ '[' -n '' ']' ++ '[' -n br-lan ']' ++ echo br-lan ++ return 0 ++ return
- local interface=br-lan
- jq -e --arg ip 192.168.68.153 --arg mac 32:c1:75:ca:66:e3 --arg name 'child pid content de..' --arg interface br-lan '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase) and .name == $name and .interface == $interface) | .ip' /tmp/wechatpush/devices.json
- '[' -f /tmp/wechatpush/openwrt_info ']'
- '[' -f /tmp/wechatpush/miwifi_info ']'
- '[' -z '' ']' ++ jq -r --arg ip 192.168.68.153 '.[] | select(.ip == $ip) | .type' /tmp/wechatpush/miwifi_info
- local tmp_type= ++ jq -r --arg ip 192.168.68.153 '.[] | select(.ip == $ip) | .parent' /tmp/wechatpush/miwifi_info
- local tmp_parent=
- '[' -f /tmp/wechatpush/gateway_info ']'
- '[' -n '' ']'
In the file /tmp/wechatpush/devices.json, what is the stored value for the IP 192.168.68.153? Has it saved an incorrect name?
View the complete device information of the IP
jq --arg ip "192.168.68.153" '.devices[] | select(.ip == $ip)' /tmp/wechatpush/devices.json
It’s the same. The bot is running well but I think the parser has problem with kernel 6 { "name": "child pid content de..", "ip": "192.168.68.153", "mac": "32:c1:75:ca:66:e3", "interface": "br-lan", "uptime": "1746371807", "usage": "", "http_access": "", "status": "online" }
It’s the same. The bot is running well but I think the parser has problem with kernel 6 { "name": "child pid content de..", "ip": "192.168.68.153", "mac": "32:c1:75:ca:66:e3", "interface": "br-lan", "uptime": "1746371807", "usage": "", "http_access": "", "status": "online" }
I am unable to reproduce this error here. Initially, I suspect it may be due to version inconsistencies in bash or jq, leading to certain unsupported commands.
In the following command snippet:
+++ jq -r --arg ip 192.168.68.153 --arg mac 32:c1:75:ca:66:e3 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .name' /tmp/wechatpush/devices.json
++ tmp_name='child pid content de..'
The command has already read an incorrect device name from the cache file. However, the root cause of this incorrect device name likely does not originate from this particular command. To identify the exact faulty command, you'll need to clear the file and rerun the process.
This is the full log about IP address 192.168.68.119. I'm running kwrt (openwrt.ai) 24.10 with iptables instead of nftables.
++ cat /proc/net/arp ++ grep -w 192.168.68.119 ++ awk '{print $6}' ++ grep -v '^$' ++ sort -u ++ head -n1
- interface=br-lan ++ seq 1 2
- for i in $(seq 1 "$retry_count")
- '[' -n br-lan ']' ++ cat /proc/net/arp ++ grep '0x[26]' ++ grep -i -w c8:2e:18:37:ec:e4 ++ wc -l
- local arp_entry_count=1
- '[' -n 1 ']'
- '[' 1 -le 1 ']' ++ run_with_tag arping -I br-lan -c 20 -f -w 10 192.168.68.119
- ip_ms='ARPING 192.168.68.119 from 192.168.68.1 br-lan Unicast reply from 192.168.68.119 [C8:2E:18:37:EC:E4] 86.415ms Sent 1 probes (1 broadcast(s)) Received 1 response(s)'
- grep -q ms
- echo 'ARPING 192.168.68.119 from 192.168.68.1 br-lan Unicast reply from 192.168.68.119 [C8:2E:18:37:EC:E4] 86.415ms Sent 1 probes (1 broadcast(s)) Received 1 response(s)'
- break
- unset i
- echo 'ARPING 192.168.68.119 from 192.168.68.1 br-lan Unicast reply from 192.168.68.119 [C8:2E:18:37:EC:E4] 86.415ms Sent 1 probes (1 broadcast(s)) Received 1 response(s)'
- grep -q ms
- local ping_online=0
- silent_run LockFile lock
- LockFile lock
- '[' 0 -eq 1 ']' ++ getname 192.168.68.119 c8:2e:18:37:ec:e4 ++ local ip=192.168.68.119 ++ local mac=c8:2e:18:37:ec:e4 ++ local tmp_name ++ local oui_name ++ local name_width=20 ++ '[' -z 192.168.68.119 ']' ++ '[' -z c8:2e:18:37:ec:e4 ']' +++ cat /usr/share/wechatpush/api/device_aliases.list +++ grep -i -Ew '^192.168.68.119|^c8:2e:18:37:ec:e4' +++ awk '{for(i=2; i<=NF; i++) printf $i " "; print ""}' ++ tmp_name= ++ process_and_check '' 20 ++ '[' -z '' ']' ++ return 1 ++ '[' -f /tmp/wechatpush/gateway_info ']' ++ '[' -f /tmp/wechatpush/mikrotik_info ']' ++ '[' -f /tmp/wechatpush/miwifi_info ']' +++ jq -r --arg ip 192.168.68.119 '.[] | select(.ip == $ip) | .name' /tmp/wechatpush/miwifi_info ++ tmp_name= ++ process_and_check '' 20 ++ '[' -z '' ']' ++ return 1 ++ '[' -f /tmp/wechatpush/openwrt_info ']' +++ jq -r --arg ip 192.168.68.119 --arg mac c8:2e:18:37:ec:e4 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .name' /tmp/wechatpush/devices.json ++ tmp_name='child pid content de..' ++ '[' -n '' ']' ++ process_and_check 'child pid content de..' 20 ++ '[' -z 'child pid content de..' ']' +++ echo 'child pid content de..' +++ tr -d '\n\r' +++ awk '$1=$1' +++ sed 's/_/ /g' +++ grep -v '^$' +++ sort -u +++ head -n1 ++ local 'value=child pid content de..' ++ '[' 'child pid content de..' == unknown ']' ++ '[' -n 'child pid content de..' ']' ++ '[' -n 20 ']' +++ cut_str 'child pid content de..' 20 +++ '[' -z 'child pid content de..' ']' +++ '[' -z 20 ']' +++ local result +++ echo 'child pid content de..' ++ echo child pid content de.. ++ return 0 ++ return
- local 'name=child pid content de..' ++ getinterface ip c8:2e:18:37:ec:e4 ++ local ip=ip ++ local mac=c8:2e:18:37:ec:e4 ++ local interface ++ '[' -z c8:2e:18:37:ec:e4 ']' ++ '[' c8:2e:18:37:ec:e4 == unknown ']' +++ jq -r --arg ip ip --arg mac c8:2e:18:37:ec:e4 '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase)) | .interface' /tmp/wechatpush/devices.json ++ interface= ++ process_and_check '' ++ '[' -z '' ']' ++ return 1 ++ '[' -n '' ']' +++ cat /proc/net/arp +++ grep '0x2|0x6' +++ grep -v '^169.254.' +++ grep -i -w c8:2e:18:37:ec:e4 +++ awk '{print $6}' +++ grep -v '^$' +++ sort -u ++ interface=br-lan ++ process_and_check br-lan ++ '[' -z br-lan ']' +++ echo br-lan +++ tr -d '\n\r' +++ awk '$1=$1' +++ sed 's/_/ /g' +++ grep -v '^$' +++ sort -u +++ head -n1 ++ local value=br-lan ++ '[' br-lan == unknown ']' ++ '[' -n br-lan ']' ++ '[' -n '' ']' ++ '[' -n br-lan ']' ++ echo br-lan ++ return 0 ++ return
- local interface=br-lan
- jq -e --arg ip 192.168.68.119 --arg mac c8:2e:18:37:ec:e4 --arg name 'child pid content de..' --arg interface br-lan '.devices[] | select(.ip == $ip and (.mac | ascii_downcase) == ($mac | ascii_downcase) and .name == $name and .interface == $interface) | .ip' /tmp/wechatpush/devices.json
- '[' -f /tmp/wechatpush/openwrt_info ']'
- '[' -f /tmp/wechatpush/miwifi_info ']'
- '[' -z '' ']' ++ jq -r --arg ip 192.168.68.119 '.[] | select(.ip == $ip) | .type' /tmp/wechatpush/miwifi_info
- local tmp_type= ++ jq -r --arg ip 192.168.68.119 '.[] | select(.ip == $ip) | .parent' /tmp/wechatpush/miwifi_info
- local tmp_parent=
- '[' -f /tmp/wechatpush/gateway_info ']'
- '[' -n '' ']'
- silent_run LockFile unlock
- LockFile unlock
- echo
- for ip in $IPLIST
- '[' -n '' ']'
- read -u 5
- down 192.168.68.122
and this is the content in /tmp/wechatpush/devices.json { "name": "child pid content de..", "ip": "192.168.68.119", "mac": "c8:2e:18:37:ec:e4", "interface": "br-lan", "uptime": "1746371799", "usage": "", "http_access": "", "status": "online" },
