| Conditions | 3 |
| Total Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import os |
||
| 26 | def create_config(): |
||
| 27 | default = """\ |
||
| 28 | verbose: False |
||
| 29 | debug: False |
||
| 30 | simulate: False |
||
| 31 | |||
| 32 | server: |
||
| 33 | ips_file: "/etc/trdb/endpoints" |
||
| 34 | mmdb: "/etc/trdb/GeoIP2-ISP.mmdb" |
||
| 35 | bind: 127.0.0.1 |
||
| 36 | port: 9001 |
||
| 37 | |||
| 38 | runner: |
||
| 39 | ips_file: "/etc/trdb/endpoints" |
||
| 40 | # hostname: "" |
||
| 41 | remote_ips: False |
||
| 42 | # will overide ips_file and ips from server (remote_ips) |
||
| 43 | # ips: |
||
| 44 | # - "8.8.8.8" |
||
| 45 | # - "1.1.1.1" |
||
| 46 | server_url: "http://127.0.0.1:9001" |
||
| 47 | procs: 10 |
||
| 48 | # Multiple parsers are planned, currently the NANOG traceroute is supported, |
||
| 49 | # vanilla "traceroute" pkg on Debian |
||
| 50 | # DO NOT use /usr/bin/traceroute or just traceroute, on debian the alternatives |
||
| 51 | # system could mess this up if you have more than one traceroute installed |
||
| 52 | traceroute_bin: /usr/bin/traceroute-nanog\n""" |
||
| 53 | |||
| 54 | try: |
||
| 55 | with open(os.path.expanduser("~/.trdb.yaml"), "w") as f: |
||
| 56 | f.write(default) |
||
| 57 | except: |
||
| 58 | print "Failed to write out example config" |
||
| 59 | sys.exit(1) |
||
| 60 |