Last change
on this file since 87c2a6a was
87c2a6a,
checked in by OpenGnSys Support Team <soporte-og@…>, 5 years ago
|
fix shebang
|
-
Property mode set to
100755
|
File size:
854 bytes
|
Line | |
---|
1 | #!/usr/bin/python3 |
---|
2 | |
---|
3 | # |
---|
4 | # Copyright (C) 2020 Soleta Networks <info@soleta.eu> |
---|
5 | # |
---|
6 | # This program is free software: you can redistribute it and/or modify it under |
---|
7 | # the terms of the GNU Affero General Public License as published by the |
---|
8 | # Free Software Foundation, version 3. |
---|
9 | # |
---|
10 | |
---|
11 | import json |
---|
12 | import subprocess |
---|
13 | from src.ogClient import * |
---|
14 | from signal import signal, SIGPIPE, SIG_DFL |
---|
15 | |
---|
16 | def main(): |
---|
17 | signal(SIGPIPE, SIG_DFL) |
---|
18 | config_path = f'{ogClient.OG_PATH}ogclient/cfg/ogclient.json' |
---|
19 | try: |
---|
20 | with open(config_path, 'r') as f: |
---|
21 | CONFIG = json.load(f) |
---|
22 | except: |
---|
23 | print('Error: Parsing configuration file') |
---|
24 | return 0 |
---|
25 | |
---|
26 | MODE = CONFIG['opengnsys']['mode'] |
---|
27 | URL = CONFIG['opengnsys']['url'] |
---|
28 | if MODE == 'live': |
---|
29 | proc = subprocess.Popen(["browser", "-qws", URL]) |
---|
30 | |
---|
31 | client = ogClient(config=CONFIG) |
---|
32 | client.connect() |
---|
33 | client.run() |
---|
34 | |
---|
35 | if __name__ == "__main__": |
---|
36 | main() |
---|
Note: See
TracBrowser
for help on using the repository browser.