12 lines
536 B
Python
12 lines
536 B
Python
#!/usr/bin/env python3
|
|
"""Run the same durable recovery implementation through one SSH connection."""
|
|
import base64
|
|
from pathlib import Path
|
|
import shlex
|
|
import subprocess
|
|
import sys
|
|
|
|
script = base64.b64encode(Path(__file__).with_name('deploy-update-remote.py').read_bytes()).decode('ascii')
|
|
program = "import base64; exec(compile(base64.b64decode('" + script + "'), 'deploy-update-remote.py', 'exec'))"
|
|
raise SystemExit(subprocess.call(['ssh', '-o', 'BatchMode=yes', sys.argv[1], 'python3 -c ' + shlex.quote(program) + ' --recover']))
|