Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
from os import environ
from sys import argv
from shutil import which
from subprocess import check_output
def main():
(introducerFURL,) = argv[1:]
# PYTHONHOME set for Python 3 for this script breaks Python 2 used by
# Tahoe. :/ This is kind of a NixOS Python packaging bug.
del environ["PYTHONHOME"]
run(["tahoe", "--version"])
run([
"tahoe", "create-client",
"--shares-needed", "1",
"--shares-happy", "1",
"--shares-total", "1",
"--introducer", introducerFURL,
"/tmp/client",
])
run([
"daemonize",
"-o", "/tmp/stdout",
"-e", "/tmp/stderr",
which("tahoe"), "run", "/tmp/client",
])
def run(argv):
print("{}: {}".format(argv, check_output(argv)))
if __name__ == '__main__':
main()