|
6 | 6 |
|
7 | 7 | from modules.module import MtcModule |
8 | 8 | from mypylib.mypylib import run_as_root, color_print, bcolors, print_table |
| 9 | +from mytonctrl.utils import get_current_user |
9 | 10 |
|
10 | 11 |
|
11 | 12 | class BtcTeleportModule(MtcModule): |
@@ -59,12 +60,13 @@ def create_env_file(self, reinit=False): |
59 | 60 | def add_daemon(self): |
60 | 61 | start = f'{self.bin_dir}/oracle' |
61 | 62 | script_path = pkg_resources.resource_filename('mytoninstaller', 'scripts/add2systemd.sh') |
62 | | - user = os.environ.get("USER", "root") |
| 63 | + user = get_current_user() |
63 | 64 | run_as_root(['bash', script_path, '-n', 'btc_teleport', '-u', user, '-g', user, '-s', start, '-w', self.bin_dir]) |
64 | 65 |
|
65 | 66 | def install(self, branch): |
66 | 67 | script_path = pkg_resources.resource_filename('mytonctrl', 'scripts/btc_teleport1.sh') |
67 | | - exit_code = run_as_root(["bash", script_path, "-s", '/usr/src', "-r", self.repo_name, "-b", branch]) |
| 68 | + user = get_current_user() |
| 69 | + exit_code = run_as_root(["bash", script_path, "-s", '/usr/src', "-r", self.repo_name, "-b", branch, "-u", user]) |
68 | 70 | if exit_code != 0: |
69 | 71 | raise Exception('Failed to install btc_teleport') |
70 | 72 | script_path = pkg_resources.resource_filename('mytonctrl', 'scripts/btc_teleport2.sh') |
|
0 commit comments