Added connected and unconnected account count in activity report script.

This commit is contained in:
Christian P. MOMON 2021-05-01 03:48:27 +02:00 committed by Pierre-Louis Bonicoli
parent 513e8085dc
commit 7aeee0a4ae
Signed by: pilou
GPG Key ID: 06914C4A5EDAA6DD

View File

@ -98,6 +98,12 @@ generateSpecificReport()
local accountCount=$(curl -s "https://forge.chapril.org/api/v1/users/search?limit=100000&token=$GITEA_API_KEY" | jq '.data | length') local accountCount=$(curl -s "https://forge.chapril.org/api/v1/users/search?limit=100000&token=$GITEA_API_KEY" | jq '.data | length')
echo "Nombre de comptes = $accountCount" echo "Nombre de comptes = $accountCount"
local connectedAccountCount=$(curl -s "https://forge.chapril.org/api/v1/users/search?limit=100000&token=$GITEA_API_KEY" | jq '.data[].last_login' | grep -cv "1970")
echo "Nombre de comptes connectés au moins une fois = $connectedAccountCount"
local unconnectedAccountCount=$(curl -s "https://forge.chapril.org/api/v1/users/search?limit=100000&token=$GITEA_API_KEY" | jq '.data[].last_login' | grep -c "1970")
echo "Nombre de comptes jamais connectés = $unconnectedAccountCount"
#$(curl -s "https://forge.chapril.org/api/v1/admin/orgs?limit=100000&token=$GITEA_API_KEY" | jq '. | length' > t) #$(curl -s "https://forge.chapril.org/api/v1/admin/orgs?limit=100000&token=$GITEA_API_KEY" | jq '. | length' > t)
local organizationCount=$(curl -s "https://forge.chapril.org/api/v1/admin/orgs?limit=100000&token=$GITEA_API_KEY" | jq '. | length') local organizationCount=$(curl -s "https://forge.chapril.org/api/v1/admin/orgs?limit=100000&token=$GITEA_API_KEY" | jq '. | length')
if [[ -z "$organizationCount" ]]; then if [[ -z "$organizationCount" ]]; then