Function
write_config
(config_dir: str, port: int)
Source from the content-addressed store, hash-verified
| 63 | |
| 64 | |
| 65 | def write_config(config_dir: str, port: int) -> None: |
| 66 | forward_port = port + 1 |
| 67 | cfg = f""" |
| 68 | [reticulum] |
| 69 | enable_transport = No |
| 70 | share_instance = No |
| 71 | shared_instance_port = 37428 |
| 72 | instance_control_port = 37429 |
| 73 | panic_on_interface_error = No |
| 74 | |
| 75 | [logging] |
| 76 | loglevel = 4 |
| 77 | |
| 78 | [interfaces] |
| 79 | |
| 80 | [[UDPInterop]] |
| 81 | type = UDPInterface |
| 82 | interface_enabled = True |
| 83 | listen_ip = 127.0.0.1 |
| 84 | listen_port = {port} |
| 85 | forward_ip = 127.0.0.1 |
| 86 | forward_port = {forward_port} |
| 87 | """ |
| 88 | with open(os.path.join(config_dir, "config"), "w") as f: |
| 89 | f.write(cfg) |
| 90 | |
| 91 | |
| 92 | def main(): |
Tested by
no test coverage detected