summaryrefslogtreecommitdiffstats
path: root/files/website
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2018-11-10 12:20:34 +0000
committerintrigeri <intrigeri@boum.org>2018-11-10 12:20:34 +0000
commit21a92c65eaad74316348562676459376454ceaa9 (patch)
tree93913b4b0c46ab9113b6f09d92ee61a96f7be0d5 /files/website
parent374233457ca0da19e8adbdc935ad49df13d571b0 (diff)
Website: send stats every month to tails@ (refs: #14588)
Diffstat (limited to 'files/website')
-rw-r--r--files/website/tails-website-last-month-stats36
1 files changed, 36 insertions, 0 deletions
diff --git a/files/website/tails-website-last-month-stats b/files/website/tails-website-last-month-stats
new file mode 100644
index 0000000..153a95f
--- /dev/null
+++ b/files/website/tails-website-last-month-stats
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+set -u
+
+LOGS_DIR="$1"
+
+export LC_ALL=C
+
+cd "$LOGS_DIR"
+
+LAST_MONTH=$(date --date='last month' '+%B')
+LAST_MONTH_ABBR=$(date --date='last month' '+%b')
+
+LOG_FILES=
+for f in $(seq 90 -1 2); do
+ log_file="access.log.$f.gz"
+ if [ -e "$log_file" ]; then
+ LOG_FILES="${LOG_FILES} ${log_file}"
+ fi
+done
+for log_file in access.log.1 access.log ; do
+ if [ -e "$log_file" ]; then
+ LOG_FILES="${LOG_FILES} ${log_file}"
+ fi
+done
+
+echo -n "Boots in $LAST_MONTH: "
+zgrep --count -E \
+ "/${LAST_MONTH_ABBR}/.*\"GET /security/index\.[a-z]{2}\.atom HTTP/[0-9]\.[0-9]\" 200 [0-9]+ \"-\" \"(-|libwww-perl/)" \
+ $LOG_FILES
+
+echo -n "Downloads of the OpenPGP signature in $LAST_MONTH: "
+zgrep --count -E \
+ "/${LAST_MONTH_ABBR}/.*\"GET /torrents/files/tails-[-a-z0-9~.]\+\.iso\.sig .* 200 [0-9]\+" \
+ $LOG_FILES