migrate TorData path
This commit is contained in:
parent
52bc986260
commit
a4de5127dc
1 changed files with 10 additions and 0 deletions
10
oml/tor.py
10
oml/tor.py
|
@ -1,4 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
@ -45,6 +46,15 @@ CookieAuthentication 1
|
||||||
DataDirectory {base}/TorData
|
DataDirectory {base}/TorData
|
||||||
DirReqStatistics 0
|
DirReqStatistics 0
|
||||||
'''.strip().format(base=settings.data_path))
|
'''.strip().format(base=settings.data_path))
|
||||||
|
else:
|
||||||
|
with open(torrc, 'r') as fd:
|
||||||
|
data = fd.read()
|
||||||
|
modified_data = re.sub('DataDirectory.*?/TorData',
|
||||||
|
'DataDirectory {base}/TorData'.format(base=settings.data_path), data)
|
||||||
|
if data != modified_data:
|
||||||
|
with open(torrc, 'w') as fd:
|
||||||
|
fd.write(modified_data)
|
||||||
|
|
||||||
return defaults, torrc
|
return defaults, torrc
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Reference in a new issue