reverse config
This commit is contained in:
parent
28c4d14b12
commit
569ca0d0a4
2 changed files with 8 additions and 9 deletions
|
@ -42,8 +42,7 @@ def main():
|
||||||
'will be ignored')
|
'will be ignored')
|
||||||
else:
|
else:
|
||||||
config['port_password'] = {}
|
config['port_password'] = {}
|
||||||
server_port = config.get('server_port', None)
|
server_port = config['server_port']
|
||||||
if server_port:
|
|
||||||
if type(server_port) == list:
|
if type(server_port) == list:
|
||||||
for a_server_port in server_port:
|
for a_server_port in server_port:
|
||||||
config['port_password'][a_server_port] = config['password']
|
config['port_password'][a_server_port] = config['password']
|
||||||
|
|
|
@ -93,7 +93,7 @@ def check_config(config, is_local):
|
||||||
if 'local_port' in config:
|
if 'local_port' in config:
|
||||||
config['local_port'] = int(config['local_port'])
|
config['local_port'] = int(config['local_port'])
|
||||||
|
|
||||||
if config.get('server_port', None) and type(config['server_port']) != list:
|
if 'server_port' in config and type(config['server_port']) != list:
|
||||||
config['server_port'] = int(config['server_port'])
|
config['server_port'] = int(config['server_port'])
|
||||||
|
|
||||||
if config.get('local_address', '') in [b'0.0.0.0']:
|
if config.get('local_address', '') in [b'0.0.0.0']:
|
||||||
|
@ -243,7 +243,7 @@ def get_config(is_local):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(e)
|
logging.error(e)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
config['server_port'] = config.get('server_port', None)
|
config['server_port'] = config.get('server_port', 8388)
|
||||||
|
|
||||||
logging.getLogger('').handlers = []
|
logging.getLogger('').handlers = []
|
||||||
logging.addLevelName(VERBOSE_LEVEL, 'VERBOSE')
|
logging.addLevelName(VERBOSE_LEVEL, 'VERBOSE')
|
||||||
|
|
Loading…
Add table
Reference in a new issue