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