ogclient: add --server-ip flag to override the server's IP

Add CLI flag to override the server IP defined in the config file.
master
Alejandro Sirgo Rica 2024-10-02 10:38:03 +02:00
parent f1b1532f78
commit a2baad8c0b
1 changed files with 5 additions and 0 deletions

View File

@ -50,6 +50,8 @@ def create_parser():
parser.add_argument('--debug', default=False,
action='store_true',
help='enables debug log level')
parser.add_argument('--server-ip', default="",
help='Server IP address override')
return parser
@ -75,6 +77,9 @@ def main():
print('Error: Parsing configuration file')
return 0
if args.server_ip:
CONFIG['opengnsys']['ip'] = args.server_ip
MODE = CONFIG['opengnsys']['mode']
URL = CONFIG['opengnsys']['url']
LOGLEVEL = CONFIG['opengnsys']['log']