Restart lookyloo after update

pull/101/head
Fafner [_KeyZee_] 2020-10-13 15:05:36 +02:00 committed by GitHub
parent 97c4d93318
commit 3d17a98799
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()