Skip to content

Commit 9ff2b25

Browse files
committed
create local config on enabling tha
1 parent ff38709 commit 9ff2b25

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mytoninstaller/mytoninstaller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ def PrintLiteServerConfig(local, args):
194194
def CreateLocalConfigFile(local, args):
195195
initBlock = GetInitBlock()
196196
initBlock_b64 = dict2b64(initBlock)
197-
user = local.buffer["user"]
198197
args = ["python3", "-m", "mytoninstaller", "-u", local.buffer.user, "-e", "clc", "-i", initBlock_b64]
199198
run_as_root(args)
200199
#end define

mytoninstaller/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ def EnableJsonRpc(local):
462462

463463
def enable_ton_http_api(local):
464464
local.add_log("start EnableTonHttpApi function", "debug")
465+
if not os.path.exists('/usr/bin/ton/local.config.json'):
466+
from mytoninstaller.mytoninstaller import CreateLocalConfigFile
467+
CreateLocalConfigFile(local, [])
465468
ton_http_api_installer_path = pkg_resources.resource_filename('mytoninstaller.scripts', 'ton_http_api_installer.sh')
466469
exit_code = run_as_root(["bash", ton_http_api_installer_path])
467470
if exit_code == 0:

0 commit comments

Comments
 (0)