Merge pull request #101 from FafnerKeyZee/patch-3

Restart lookyloo after update
pull/102/head
Raphaël Vinot 2020-10-13 16:03:07 +02:00 committed by GitHub
commit 93dac1f479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -86,7 +86,18 @@ def main():
print('* Update third party dependencies for the website.')
keep_going(args.yes)
run_command('tools/3rdparty.py')
print('* Restarting Lookyloo.')
keep_going(args.yes)
service = "lookyloo"
p = subprocess.Popen(["systemctl", "is-active", service], stdout=subprocess.PIPE)
(output, err) = p.communicate()
if output.decode('utf-8') == "active\n":
run_command('sudo service lookyloo restart')
else:
run_command('poetry run stop')
run_command('poetry run start')
if __name__ == '__main__':
main()