@@ -176,20 +176,38 @@ def inject_globals(func):
176176 local .db .config .logLevel = "debug" if console .debug else "info"
177177 local .db .config .isLocaldbSaving = False
178178 local .run ()
179+
180+
181+ def check_installer_user ():
182+ args = ["whoami" ]
183+ process = subprocess .run (args , stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .PIPE , timeout = 3 )
184+ username = process .stdout .decode ("utf-8" ).strip ()
185+
186+ args = ["ls" , "-lh" , "/var/ton-work/keys/" ]
187+ process = subprocess .run (args , stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .PIPE , timeout = 3 )
188+ output = process .stdout .decode ("utf-8" )
189+ actual_user = output .split ('\n ' )[1 ].split ()[2 ]
190+
191+ if username != actual_user :
192+ raise Exception (f'mytonctrl was installed by another user. Probably you need to launch mtc with `{ actual_user } ` user.' )
179193#end define
180194
195+
181196def PreUp (local , ton ):
182197 CheckMytonctrlUpdate (local )
198+ check_installer_user ()
183199 check_vport (local , ton )
184200 # CheckTonUpdate()
185201#end define
186202
203+
187204def Installer (args ):
188205 # args = ["python3", "/usr/src/mytonctrl/mytoninstaller.py"]
189206 args = ["python3" , "-m" , "mytoninstaller" ]
190207 subprocess .run (args )
191208#end define
192209
210+
193211def GetAuthorRepoBranchFromArgs (args ):
194212 data = dict ()
195213 arg1 = GetItemFromList (args , 0 )
@@ -210,6 +228,7 @@ def GetAuthorRepoBranchFromArgs(args):
210228 return data
211229#end define
212230
231+
213232def check_vport (local , ton ):
214233 try :
215234 vconfig = ton .GetValidatorConfig ()
@@ -245,7 +264,8 @@ def check_git(input_args, default_repo, text):
245264 git_path = f"{ src_dir } /{ default_repo } "
246265 fix_git_config (git_path )
247266 default_author = "ton-blockchain"
248- default_branch = "master"
267+ # default_branch = "master"
268+ default_branch = "mytonctrl2"
249269
250270 # Get author, repo, branch
251271 local_author , local_repo = get_git_author_and_repo (git_path )
0 commit comments