HEX
Server: Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
System: Linux panel19.servidoresrapidos.net 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User: pastorfi (1081)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/local/sbin/arquidio-home-cache.sh
#!/bin/bash
# Refresh anonymous homepage HTML for arquidiocesisdepanama.org
set -euo pipefail
OUT=/home/arquidio/public_html/wp-content/cache/home.html
TMP=$(mktemp)
trap 'rm -f "$TMP"' EXIT
# Hit origin directly; bypass the rewrite so we get a live render.
code=$(curl -sS -k -m 45 \
  --resolve arquidiocesisdepanama.org:443:157.90.185.123 \
  -H "X-Bypass-Home-Cache: 1" \
  -H "Accept: text/html" \
  -o "$TMP" -w "%{http_code}" \
  https://arquidiocesisdepanama.org/ || echo 000)
if [ "$code" = "200" ] && [ "$(wc -c < "$TMP")" -gt 20000 ]; then
  chown arquidio:arquidio "$TMP"
  chmod 644 "$TMP"
  mv -f "$TMP" "$OUT"
  trap - EXIT
  echo "refreshed $(wc -c < "$OUT") bytes"
else
  echo "skip refresh http=$code size=$(wc -c < "$TMP" 2>/dev/null || echo 0)"
  exit 1
fi