From eaef3706467773cfb72958cb059cc6ee760046b4 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Thu, 18 Nov 2021 14:50:54 +0000 Subject: [PATCH] Update rapport_activite/rapport_activites.sh --- rapport_activite/rapport_activites.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rapport_activite/rapport_activites.sh b/rapport_activite/rapport_activites.sh index cd496a8..dcd017b 100755 --- a/rapport_activite/rapport_activites.sh +++ b/rapport_activite/rapport_activites.sh @@ -99,14 +99,14 @@ count_removable_accounts() { } count_archived_messages() { - sudo -Hiu postgres sudo -u ejabberd psql ejabberd -c "select count(*) from archive where peer not like 'irc%' and username not in ('r.giskard', 'lisa.simpson', 'bart.simpson')" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql ejabberd -c "select count(*) from archive where peer not like 'irc%' and username not in ('r.giskard', 'lisa.simpson', 'bart.simpson')" -t | grep -v '^$' | awk '{print $1}' } count_biboumi_users() { sql="select count(distinct owner_) from muclogline_" - sudo -Hiu postgres sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' } count_biboumi_active_users() { @@ -121,7 +121,7 @@ count_biboumi_active_users() { where m2.owner_ = m1.owner_ ) ) as m0 where to_timestamp(m0.date_) > current_timestamp - interval '${since}'" - sudo -Hiu postgres sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' } count_biboumi_active_external_users() { @@ -137,7 +137,7 @@ count_biboumi_active_external_users() { where to_timestamp(m0.date_) > current_timestamp - interval '${since}' and m0.owner_ not like '%chalec.org%'" - sudo -Hiu postgres sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' } count_biboumi_inactive_users() { @@ -152,7 +152,7 @@ count_biboumi_inactive_users() { where m2.owner_ = m1.owner_ ) ) as m0 where to_timestamp(m0.date_) < current_timestamp - interval '${since}'" - sudo -Hiu postgres sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' } count_biboumi_inactive_external_users() { @@ -168,7 +168,7 @@ count_biboumi_inactive_external_users() { where to_timestamp(m0.date_) < current_timestamp - interval '${since}' and m0.owner_ not like '%chalec.org%'" - sudo -Hiu postgres sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' } count_biboumi_archived_messages() { @@ -176,7 +176,7 @@ count_biboumi_archived_messages() { sql="select count(body_) from muclogline_" - sudo -Hiu postgres sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' } count_biboumi_active_servers() { @@ -185,7 +185,7 @@ count_biboumi_active_servers() { from muclogline_ where to_timestamp(date_) > current_timestamp - interval '${since}'" - sudo -Hiu postgres sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' } count_biboumi_active_chan() { @@ -194,7 +194,7 @@ count_biboumi_active_chan() { from muclogline_ where to_timestamp(date_) > current_timestamp - interval '${since}'" - sudo -Hiu postgres sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' + sudo -u ejabberd psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}' } get_last_month() {