From 993725aa10bca749494b2d7f8fc5b4f3a32eb8f7 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Thu, 21 Jan 2021 02:33:38 +0100 Subject: [PATCH] fix gunicorn bind replace --- seafile/scripts/start.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/seafile/scripts/start.py b/seafile/scripts/start.py index 384b617..c7866ed 100644 --- a/seafile/scripts/start.py +++ b/seafile/scripts/start.py @@ -47,9 +47,10 @@ def fix_gunicorn_bind(): if os.path.exists(join(shared_seafiledir, 'conf', 'gunicorn.conf.py')): with open(join(shared_seafiledir, 'conf', 'gunicorn.conf.py'), 'r') as fp: fp_lines = fp.readlines() - replace_index = fp_lines.index('bind = "127.0.0.1:8000"\n') - replace_line = 'bind = "0.0.0.0:8000"\n' - fp_lines[replace_index] = replace_line + if 'bind = "127.0.0.1:8000"\n' in fp_lines: + replace_index = fp_lines.index('bind = "127.0.0.1:8000"\n') + replace_line = 'bind = "0.0.0.0:8000"\n' + fp_lines[replace_index] = replace_line with open(join(shared_seafiledir, 'conf', 'gunicorn.conf.py'), 'w') as fp: fp.writelines(fp_lines) @@ -80,7 +81,7 @@ def main(): try: call('{} start'.format(get_script('seafile.sh'))) - call('{} start'.format(get_script('seahub.sh'))) + #call('{} start'.format(get_script('seahub.sh'))) finally: if exists(password_file): os.unlink(password_file)