mirror of
https://git.photon.obnh.io/AXSY/whois.git
synced 2025-12-11 04:39:15 +00:00
Based on mwhois by Antonios A. Chariton Modifications for SCION AS support by Olaf Baumert, Axpo Systems AG
35 lines
803 B
Python
Executable File
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.")
|