mirror of https://github.com/tp4a/teleport
. Installer for Linux support upgrade for non-default install path.
parent
597cff60d7
commit
7b08bd2fa2
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue