mirror of
https://gitlab.com/fscarmen/warp.git
synced 2026-06-15 03:25:42 +08:00
Replace the script execution count tracking service.
This commit is contained in:
@@ -426,7 +426,7 @@ statistics_of_run-times() {
|
||||
local UPDATE_OR_GET=$1
|
||||
local SCRIPT=$2
|
||||
if grep -q 'update' <<< "$UPDATE_OR_GET"; then
|
||||
{ wget -qO- --timeout=3 "https://stat-api.netlify.app/updateStats?script=${SCRIPT}" > /tmp/statistics; }&
|
||||
{ wget --no-check-certificate -qO- --timeout=3 "http://stat.cloudflare.now.cc:4000/api/updateStats?script=${SCRIPT}" > /tmp/statistics; }&
|
||||
elif grep -q 'get' <<< "$UPDATE_OR_GET"; then
|
||||
[ -s /tmp/statistics ] && [[ $(cat /tmp/statistics) =~ \"todayCount\":([0-9]+),\"totalCount\":([0-9]+) ]] && local TODAY="${BASH_REMATCH[1]}" && local TOTAL="${BASH_REMATCH[2]}" && rm -f /tmp/statistics
|
||||
info " $(text 41) "
|
||||
|
||||
+1
-1
@@ -262,7 +262,7 @@ statistics_of_run-times() {
|
||||
local UPDATE_OR_GET=$1
|
||||
local SCRIPT=$2
|
||||
if grep -q 'update' <<< "$UPDATE_OR_GET"; then
|
||||
{ wget -qO- --timeout=3 "https://stat-api.netlify.app/updateStats?script=${SCRIPT}" > /tmp/statistics; }&
|
||||
{ wget --no-check-certificate -qO- --timeout=3 "http://stat.cloudflare.now.cc:4000/api/updateStats?script=${SCRIPT}" > /tmp/statistics; }&
|
||||
elif grep -q 'get' <<< "$UPDATE_OR_GET"; then
|
||||
[ -s /tmp/statistics ] && [[ $(cat /tmp/statistics) =~ \"todayCount\":([0-9]+),\"totalCount\":([0-9]+) ]] && TODAY="${BASH_REMATCH[1]}" && TOTAL="${BASH_REMATCH[2]}" && rm -f /tmp/statistics
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user