33 lines
941 B
Bash
Executable File
33 lines
941 B
Bash
Executable File
#!/bin/bash
|
|
# OPUS5 ROOT FIX 11435 → 11434
|
|
# Run as: sudo bash /var/www/html/api/opus5-root-fix-11435.sh
|
|
# GOLDs already created in /opt/wevads/vault/*.GOLD-pre-11434-*
|
|
set -e
|
|
echo "=== OPUS5 ROOT FIX 11435→11434 ==="
|
|
FILES=(
|
|
admin-saas.html
|
|
admin-v2.html
|
|
ai-hub.html
|
|
cron-control.html
|
|
enterprise-management.html
|
|
enterprise-model.html
|
|
ops-center.html
|
|
tools-hub.html
|
|
wiki.html
|
|
)
|
|
TOTAL=0
|
|
for f in "${FILES[@]}"; do
|
|
FP="/var/www/html/$f"
|
|
if [ ! -f "$FP" ]; then continue; fi
|
|
BEFORE=$(grep -c 11435 "$FP" 2>/dev/null || echo 0)
|
|
chattr -i "$FP" 2>/dev/null || true
|
|
sed -i 's/11435/11434/g' "$FP"
|
|
AFTER=$(grep -c 11435 "$FP" 2>/dev/null || echo 0)
|
|
chattr +i "$FP" 2>/dev/null || true
|
|
echo "$f: $BEFORE → $AFTER (removed)"
|
|
TOTAL=$((TOTAL + BEFORE - AFTER))
|
|
done
|
|
echo "=== TOTAL replacements: $TOTAL ==="
|
|
echo "Rollback if needed:"
|
|
echo " cp /opt/wevads/vault/<file>.GOLD-pre-11434-* /var/www/html/<file>"
|