joininbox/scripts/start.script.tor.py
2020-03-18 11:01:32 +00:00

26 lines
No EOL
885 B
Python

#!/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python
import subprocess
import sys
import os
SCRIPT = sys.argv[1]
WALLET = sys.argv[2]
f = open('/home/joinmarket/.pw','r')
PW = f.read().strip()
f.close()
os.system('rm -f /home/joinmarket/.pw')
logfile = open('%s.log' %SCRIPT, 'w')
process = subprocess.Popen(['torify', 'python', '/home/joinmarket/joinmarket-clientserver/scripts/%s.py' %SCRIPT,'%s.jmdat' %WALLET, '--wallet-password-stdin'],
stdin=subprocess.PIPE,
universal_newlines=True,
stderr=subprocess.STDOUT,
stdout=logfile)
process.stdin.write ("%s" %PW)
process.stdin.close()
process.wait()
logfile.close()