#!/bin/bash set -e SITE_DIR="/var/www/outsidethebox.top" cd "$SITE_DIR" || exit 1 STAMP="$(date +%Y%m%d-%H%M%S)" BKDIR="backups/shared-brand-$STAMP" mkdir -p "$BKDIR" cp -av index.html pricing.html terms.html contact.html assets/style.css "$BKDIR"/ HEADER="$(cat /home/def/otb-shared-brand/header.html)" FOOTER="$(cat /home/def/otb-shared-brand/footer.html)" BRANDCSS="$(cat /home/def/otb-shared-brand/brand.css)" python3 - <' in text: text = re.sub(r'', header, text, count=1, flags=re.S) elif '
' in text: text = re.sub(r'
.*?
', header, text, count=1, flags=re.S) else: text = text.replace('', '\\n' + header, 1) if '
' in text: text = re.sub(r'
.*?
\\s*
', footer, text, count=1, flags=re.S) else: text = text.replace('', footer + '\\n', 1) p.write_text(text, encoding="utf-8") cssp = Path("assets/style.css") css = cssp.read_text(encoding="utf-8") if "/* ===== OTB shared branding ===== */" in css: css = re.sub(r'/\\* ===== OTB shared branding ===== \\*/.*', brandcss, css, flags=re.S) else: css += "\\n\\n" + brandcss cssp.write_text(css, encoding="utf-8") print("mintme deploy complete") PY