source: ogClient-Git/ogclient @ cc0d987

Last change on this file since cc0d987 was cb9edc8, checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago

ogClient is AGPLv3+

Update license header in files.

  • Property mode set to 100755
File size: 920 bytes
Line 
1#!/usr/bin/python3
2
3#
4# Copyright (C) 2020-2021 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; either version 3 of the License, or
9# (at your option) any later version.
10
11import json
12import subprocess
13from src.ogClient import *
14from signal import signal, SIGPIPE, SIG_DFL
15
16def 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
35if __name__ == "__main__":
36        main()
Note: See TracBrowser for help on using the repository browser.