From f85b69ea31519d463de809f17e03f4a2e034d74c Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 1 Jan 2021 15:12:21 +0100 Subject: [PATCH] Corrected A/V call count --- captcha/experimental.sh | 2 +- rapport_activite/rapport_activites.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/captcha/experimental.sh b/captcha/experimental.sh index ce1c940..3934758 100755 --- a/captcha/experimental.sh +++ b/captcha/experimental.sh @@ -21,7 +21,7 @@ if test -n ${BASH_VERSION:-''} ; then R=$RANDOM } else - for n in `od -A n -t u2 -N 48 /dev/urandom`; do RL="$RL$n "; done + for n in `od -A n -t u2 -N 64 /dev/urandom`; do RL="$RL$n "; done get_random () { R=${RL%% *} diff --git a/rapport_activite/rapport_activites.sh b/rapport_activite/rapport_activites.sh index bcfce1b..a224cb8 100755 --- a/rapport_activite/rapport_activites.sh +++ b/rapport_activite/rapport_activites.sh @@ -27,7 +27,7 @@ main() { echo "h2. ## Audio/Video Call usage:" # Dans la config actuelle de logrotate, le log du mois dernier est stocké en tete clair, et tous les autres sont compressés par gzip. Un cat ne sortira de texte lisible que pour les fichiers en clair soit forcément celui du mois précédent echo "" - echo "* Number of calls relayed: $(zgrep DATE /var/log/ejabberd/ejabberd.log* | grep -i -e "Offering stun" | wc -l)" + echo "* Number of calls relayed: $(zgrep $DATE /var/log/ejabberd/ejabberd.log* | grep -i -e "Offering stun" | wc -l)" echo "* Data relayed per protocol per call:" echo "** UDP: avg $(get_avg_UDP_turn_relayed_data) KiB, max $(get_max_UDP_turn_relayed_data) KiB, total $(get_total_UDP_turn_relayed_data) KiB" echo "** TCP: avg $(get_avg_TCP_turn_relayed_data) KiB, max $(get_max_TCP_turn_relayed_data) KiB, total $(get_total_TCP_turn_relayed_data) KiB" @@ -112,7 +112,7 @@ get_last_month() { } get_total_UDP_turn_relayed_data() { - n=$(zgrep $DATE /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "UDP" | cut -d" " -f6-6 | paste -sd+ - | bc) + n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "UDP" | cut -d" " -f6-6 | paste -sd+ - | bc) if [ -z $n ]; then echo 0 else @@ -121,7 +121,7 @@ get_total_UDP_turn_relayed_data() { } get_total_TCP_turn_relayed_data() { - n=$(zgrep $DATE /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TCP" | cut -d" " -f6-6 | paste -sd+ - | bc) + n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TCP" | cut -d" " -f6-6 | paste -sd+ - | bc) if [ -z $n ]; then echo 0 else @@ -130,7 +130,7 @@ get_total_TCP_turn_relayed_data() { } get_total_TLS_turn_relayed_data() { - n=$(zgrep $DATE /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TLS" | cut -d" " -f6-6 | paste -sd+ - | bc) + n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TLS" | cut -d" " -f6-6 | paste -sd+ - | bc) if [ -z $n ]; then echo 0 else @@ -139,7 +139,7 @@ get_total_TLS_turn_relayed_data() { } get_max_UDP_turn_relayed_data() { - n=$(zgrep $DATE /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "UDP" | cut -d" " -f6-6 | sort | tail -n 1) + n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "UDP" | cut -d" " -f6-6 | sort | tail -n 1) if [ -z $n ]; then echo 0 else @@ -148,7 +148,7 @@ get_max_UDP_turn_relayed_data() { } get_max_TCP_turn_relayed_data() { - n=$(zgrep $DATE /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TCP" | cut -d" " -f6-6 | sort | tail -n 1) + n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TCP" | cut -d" " -f6-6 | sort | tail -n 1) if [ -z $n ]; then echo 0 else @@ -157,7 +157,7 @@ get_max_TCP_turn_relayed_data() { } get_max_TLS_turn_relayed_data() { - n=$(zgrep $DATE /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TLS" | cut -d" " -f6-6 | sort | tail -n 1) + n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TLS" | cut -d" " -f6-6 | sort | tail -n 1) if [ -z $n ]; then echo 0 else