#!/bin/bash
# Re-record every lesson's shots and rebuild (no voicing). Output: x/rerecord.log
cd /home/whats/www/help-kit
for s in employee-login employee-permissions chat-assignment team-chat quick-replies chat-statuses contact-groups services daily-tickets daily-planner ai-knowledge; do
  echo "== $s"
  timeout 200 node rec-$s.mjs 2>&1 | grep -v "WRITE\|activity" | grep -i "fail\|error\|rects\|restored" | head -5
  python3 build.py $s | grep -i "slides\|PROBLEM"
done
chown -R easychat:easychat /home/easychat/public_html/help
echo DONE
