Files
whois/add-isd
Olaf Baumert 34c631a06d Initial commit: mwhois with SCION AS support and decimal AS conversion
Based on mwhois by Antonios A. Chariton
Modifications for SCION AS support by Olaf Baumert, Axpo Systems AG
2025-06-03 11:01:02 +00:00

35 lines
803 B
Python
Executable File

#!/usr/bin/python
# Use this file to add SCION ISD entries to the whois database
import os
# Ensure the ISD database directory exists
os.system("mkdir -p db/isd")
isd = input("Enter ISD number: ")
# Validate ISD number
if not isd.isdigit():
print("Invalid ISD number. Expected a numeric value.")
exit(1)
# Get ISD details
name = input("Enter ISD Name: ")
comment = input("Enter Comment: ")
trc_bundle = input("Enter TRC Bundle: ")
# Prepare ISD data
n = "\r\n"
body = "% SCION ISD WHOIS Information" + n + n
body += "ISD: " + isd + n
body += "Name: " + name + n
body += "Comment: " + comment + n
body += "TRC Bundle: " + trc_bundle + n
# Save to file
d = open("db/isd/" + isd, "w+")
d.write(body)
d.close()
print("Done! SCION ISD record added successfully.")