Created
March 13, 2026 02:13
-
-
Save bitnom/f5ee7cef73eea08d6b2913455b1e4a37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| exec > >(tee -a /var/log/apothic-capability-probe.log) 2>&1 | |
| echo "[apothic-capability-probe] starting $(date -Is)" | |
| python3 - <<'PY' | |
| import base64 | |
| import os | |
| import ssl | |
| import urllib.request | |
| from pathlib import Path | |
| payload_url = os.environ.get("APOTHIC_PROBE_PY_URL", "").strip() | |
| if payload_url: | |
| with urllib.request.urlopen(payload_url, context=ssl._create_unverified_context(), timeout=30) as resp: | |
| payload = resp.read() | |
| else: | |
| payload = base64.b64decode(os.environ.get("APOTHIC_PROBE_PY_B64", "")) | |
| path = Path("/opt/apothic/capability_probe.py") | |
| path.parent.mkdir(parents=True, exist_ok=True) | |
| path.write_bytes(payload) | |
| PY | |
| python3 /opt/apothic/capability_probe.py | |
| echo "[apothic-capability-probe] completed $(date -Is)" | |
| sleep 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment