From 38b39b415946e7ee949e8a1f3ed75afeb113887e Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 23 May 2020 18:57:16 +0800 Subject: [PATCH] luci-app-serverchan: sync with upstream source --- .../luci-app-serverchan/root/usr/bin/serverchan/serverchan | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 135643cf62..fda34a6fd2 100755 --- a/package/ctcgfw/luci-app-serverchan/root/usr/bin/serverchan/serverchan +++ b/package/ctcgfw/luci-app-serverchan/root/usr/bin/serverchan/serverchan @@ -164,7 +164,7 @@ function usage(){ [ ! -f "${dir}usage.db" ] && echo `bytes_for_humans 0` && return [ -z "$total_n" ] && total_n=`cat ${dir}usage.db|head -n1|grep "total"|sed 's/,/\n/g'|awk '/total/{print NR}'` 2>/dev/null [ -z "$total_n" ] && total_n="6" - [ "$2" ] && local tmptotal=`cat ${dir}usage.db|sed 's/,/ /g'|grep -i -w ${2}|awk "{print "'$'$total_n"}"|grep -v "^$"|sort -u` 2>/dev/null + [ "$2" ] && local tmptotal=`cat ${dir}usage.db|sed 's/,,,/,0,0,/g'|sed 's/,,/,0,/g'|sed 's/,/ /g'|grep -i -w ${2}|awk "{print "'$'$total_n"}"|grep -v "^$"|sort -u` 2>/dev/null [ -z "$tmptotal" ] && local tmptotal="0" [ ! "$3" ] && echo `bytes_for_humans ${tmptotal}` || echo $tmptotal elif [ $1 == "down" ] ;then @@ -873,4 +873,4 @@ while [ "$serverchan_enable" -eq "1" ]; do sleep $sleeptime done sleep $sleeptime -done \ No newline at end of file +done