cd /home/def/otb_billing || exit 1 set -e STAMP="$(date +%Y%m%d-%H%M%S)" echo "===== backups =====" cp templates/includes/site_nav.html "templates/includes/site_nav.html.bak.${STAMP}" cp templates/includes/otb_statusbar.html "templates/includes/otb_statusbar.html.bak.${STAMP}" 2>/dev/null || true cp templates/portal_login.html "templates/portal_login.html.bak.${STAMP}" cp templates/portal_dashboard.html "templates/portal_dashboard.html.bak.${STAMP}" 2>/dev/null || true cp templates/portal_set_password.html "templates/portal_set_password.html.bak.${STAMP}" 2>/dev/null || true cp templates/portal_terms.html "templates/portal_terms.html.bak.${STAMP}" 2>/dev/null || true cp templates/portal_invoice_detail.html "templates/portal_invoice_detail.html.bak.${STAMP}" 2>/dev/null || true cp templates/portal_forgot_password.html "templates/portal_forgot_password.html.bak.${STAMP}" 2>/dev/null || true cp static/css/style.css "static/css/style.css.bak.${STAMP}" 2>/dev/null || true cp static/brand.js "static/brand.js.bak.${STAMP}" 2>/dev/null || true echo "===== sync shared nav/footer assets from mintme-backed shared brand =====" cp /opt/otb/otb-shared-brand/fragments/header.html templates/includes/site_nav.html cat > templates/includes/otb_footer.html <<'EOF'
All billing is calculated in 🇨🇦 CAD Crypto conversions use the OTB Oracle Methods: Credit Card (via Square), e-Transfer, and enabled crypto assets
EOF echo "===== sync shared css/js =====" cp /var/www/outsidethebox.top/assets/brand.js static/brand.js python3 <<'PY' from pathlib import Path src = Path("/var/www/outsidethebox.top/assets/style.css") dst = Path("/home/def/otb_billing/static/css/style.css") text = src.read_text() # keep the portal's own css file as the shared base for now dst.write_text(text) print("synced style.css from shared public shell") PY echo "===== replace portal footer/statusbar blocks with shared footer include =====" python3 <<'PY' from pathlib import Path import re files = [ Path("templates/portal_login.html"), Path("templates/portal_dashboard.html"), Path("templates/portal_set_password.html"), Path("templates/portal_terms.html"), Path("templates/portal_invoice_detail.html"), Path("templates/portal_forgot_password.html"), ] for p in files: if not p.exists(): continue text = p.read_text() text = re.sub( r'
.*?
\s*\s*', '{% include "includes/otb_footer.html" %}', text, count=1, flags=re.S ) text = re.sub( r'\{\%\s*include\s+"includes/otb_statusbar\.html"\s*\%\}\s*', '{% include "includes/otb_footer.html" %}', text, count=1, flags=re.S ) text = re.sub( r'\{\%\s*include\s+"includes/otb_statusbar\.html"\s*\%\}', '{% include "includes/otb_footer.html" %}', text, count=1, flags=re.S ) p.write_text(text) print(f"updated: {p}") PY sudo systemctl restart otb_billing echo "===== done ====="