Files
html/api/handlers/opus-session-summary.sh
2026-04-19 21:55:02 +02:00

12 lines
825 B
Bash
Executable File

#!/bin/bash
# Opus 19avr: session summary of all 6sigma achievements
LAST_COMMIT=$(cd /var/www/html && git log --oneline -1 2>/dev/null | head -1)
DISK=$(df / --output=pcent | tail -1 | tr -d ' %')
UNIV=$(grep -l "OPUS UNIVERSAL DRILL-DOWN v1 19avr" /var/www/html/*.html 2>/dev/null | wc -l)
NR_RESULT=$(cd /var/www/html/api && timeout 100 php nonreg-master.php 2>&1)
NR_PASS=$(echo "$NR_RESULT" | grep -oE '[0-9]+ PASS' | head -1 | grep -oE '[0-9]+')
NR_FAIL=$(echo "$NR_RESULT" | grep -oE '[0-9]+ FAIL' | head -1 | grep -oE '[0-9]+')
cat <<EOF
{"nonreg":"$NR_PASS/$((NR_PASS+NR_FAIL))","disk_pct":$DISK,"drill_universal_pages":$UNIV,"last_commit":"$(echo $LAST_COMMIT | head -c 80)","doctrines_respected":["#2","#3","#4","#6","#13","#14","#16","#60"],"session":"opus-19avr-6sigma-true","timestamp":"$(date -Iseconds)"}
EOF