. Installer for Linux support upgrade for non-default install path.

hotfix/3.2.2-secure-fix
Apex Liu 2019-01-16 15:38:12 +08:00
parent 597cff60d7
commit 7b08bd2fa2
2 changed files with 15 additions and 2 deletions

View File

@ -14,11 +14,12 @@ from .env import env
def remove(*args):
path = os.path.join(*args)
cc.v(' - remove [%s] ... ' % path, end='')
# cc.v(' - remove [%s] ... ' % path, end='')
if not (os.path.exists(path) or os.path.islink(path)):
cc.v('not exists, skip.')
# cc.v('not exists, skip.')
return
cc.v(' - remove [%s] ... ' % path, end='')
for i in range(5):
cc.v('.', end='')
try:

View File

@ -498,6 +498,18 @@ class InstallerLinux(InstallerBase):
elif os.path.exists('/etc/init.d/teleport'):
self._is_installed = True
self._install_path = '/usr/local/teleport'
with open('/etc/init.d/teleport', 'r') as f:
lines = f.readlines()
for l in lines:
if l.startswith('DAEMON_PATH='):
l = l.replace('\r', '')
l = l.replace('\n', '')
x = l.split('=')
self._install_path = x[1]
break
# self._fix_path()
if self._is_installed: