Function
write_config
(config_dir: str, port: int)
Source from the content-addressed store, hash-verified
| 78 | |
| 79 | |
| 80 | def write_config(config_dir: str, port: int) -> None: |
| 81 | forward_port = port + 1 |
| 82 | cfg = f""" |
| 83 | [reticulum] |
| 84 | enable_transport = No |
| 85 | share_instance = No |
| 86 | shared_instance_port = 37428 |
| 87 | instance_control_port = 37429 |
| 88 | panic_on_interface_error = No |
| 89 | |
| 90 | [logging] |
| 91 | loglevel = 4 |
| 92 | |
| 93 | [interfaces] |
| 94 | |
| 95 | [[UDPInterop]] |
| 96 | type = UDPInterface |
| 97 | interface_enabled = True |
| 98 | listen_ip = 127.0.0.1 |
| 99 | listen_port = {port} |
| 100 | forward_ip = 127.0.0.1 |
| 101 | forward_port = {forward_port} |
| 102 | """ |
| 103 | with open(os.path.join(config_dir, "config"), "w") as f: |
| 104 | f.write(cfg) |
| 105 | |
| 106 | |
| 107 | def main(): |
Tested by
no test coverage detected