From c01439aefbc9ffe1f21045f669342baa506c9d59 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 16 Feb 2020 23:24:42 +0800 Subject: [PATCH] luci-app-serverchan: bump to v1.34-42 --- package/ctcgfw/luci-app-serverchan/Makefile | 2 +- .../root/usr/bin/serverchan/serverchan | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package/ctcgfw/luci-app-serverchan/Makefile b/package/ctcgfw/luci-app-serverchan/Makefile index 31addd4b03..325934aafd 100644 --- a/package/ctcgfw/luci-app-serverchan/Makefile +++ b/package/ctcgfw/luci-app-serverchan/Makefile @@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for serverchan LUCI_DEPENDS:=+iputils-arping +curl LUCI_PKGARCH:=all PKG_NAME:=luci-app-serverchan -PKG_VERSION:=1.33 +PKG_VERSION:=1.34 PKG_RELEASE:=42 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/ctcgfw/luci-app-serverchan/root/usr/bin/serverchan/serverchan b/package/ctcgfw/luci-app-serverchan/root/usr/bin/serverchan/serverchan index 06444cf0d4..a4e1447fbb 100755 --- a/package/ctcgfw/luci-app-serverchan/root/usr/bin/serverchan/serverchan +++ b/package/ctcgfw/luci-app-serverchan/root/usr/bin/serverchan/serverchan @@ -286,18 +286,16 @@ function blackwhitelist(){ # 如果 “忽略列表 为空” 并且 “关注列表为空” if [ -z "$serverchan_whitelist" ] && [ -z "$serverchan_blacklist" ] && [ -z "$serverchan_interface" ]; then echo 1 - # 如果 “忽略列表不为空” elif [ ! -z "$serverchan_whitelist" ] ; then - if ( ! echo $serverchan_whitelist | grep -q -i $1 ); then + if ( ! echo $serverchan_whitelist | grep -q -i $( cat /proc/net/arp | grep -w $1 |awk '{print $4}' | grep -v "^$" | sort -u )); then echo 1 else echo 0 fi - # 如果 “关注列表不为空” elif [ ! -z "$serverchan_blacklist" ] ; then - if ( echo $serverchan_blacklist | grep -q -i $1 ); then + if ( echo $serverchan_blacklist | grep -q -i $( cat /proc/net/arp | grep -w $1 |awk '{print $4}' | grep -v "^$" | sort -u )); then echo 1 else echo 0 @@ -541,7 +539,7 @@ function send(){ if [ -z "$ipv6_interface" ] ; then send_wanIPv6=$(ip addr show|grep -v deprecated|grep -A1 'inet6 [^f:]'|sed -nr ':a;N;s#^ +inet6 ([a-f0-9:]+)/.+? scope global .*? valid_lft ([0-9]+sec) .*#\2 \1#p;ta'|sort -nr|head -n1|cut -d' ' -f2);fi if [ ! -z "$ipv4_interface" ] ; then send_hostIP=$(curl -k -s -4 --interface $ipv4_interface $ipv4_URL);fi if [ -z "$ipv4_interface" ] ; then send_hostIP=$(curl -k -s -4 $ipv4_URL);fi - if [ ! -z "$ipv6_interface" ] ; then send_hostIPv6=$(curl -k -s -6 --interface $ipv6_interface $ipv6_URL);fi + if [ ! -z "$ipv6_interface" ] ; then send_hostIPv6=$(curl -k -s -6 --interface $send_wanIPv6 $ipv6_URL);fi if [ -z "$ipv6_interface" ] ; then send_hostIPv6=$(curl -k -s -6 $ipv6_URL);fi if [ ! -z "$router_wan" ] && [ "$router_wan" -eq "1" ] ; then send_content=${send_content}"%0D%0A%0D%0A""---%0D%0A%0D%0A#### WAN 口信息%0D%0A%0D%0A ip:$send_wanIP"