Files
felhom.eu/documentation/audits/media-drive-events-2026-10-14/tools/run_in_guest.py
T

10 lines
626 B
Python

#!/usr/bin/env python3
"""run_in_guest.py <script.py> [args] — run one of this folder's stdlib scripts INSIDE the Tester 1 guest
(SC=~/.felhom-tester1 TARGET=tester-1) and remove it afterwards. Output only; nothing is left on the box."""
import os, sys
sys.path.insert(0, "/mnt/5_hdd/felhom.eu/git/app-catalog-felhom.eu/scripts")
import box_walk as w
src = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), sys.argv[1])).read()
args = " ".join(sys.argv[2:])
print(w.guest(f"cat > /root/.media-tool.py <<'PYEOF'\n{src}\nPYEOF\npython3 /root/.media-tool.py {args} 2>&1; rm -f /root/.media-tool.py", timeout=1800))