Add DNS record management module for Mail-in-a-Box
This commit is contained in:
18
delete-record.py
Executable file
18
delete-record.py
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import miab.dns as miab_dns
|
||||
import argparse
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Delete a DNS record in Mail-in-a-Box")
|
||||
parser.add_argument("name", type=str, help="The name of the DNS record to delete")
|
||||
parser.add_argument("type", type=str, help="The type of the DNS record to delete (e.g., A, CNAME, MX)")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
miab = miab_dns.MailInABox()
|
||||
response = miab.delete_record(name=args.name, type=args.type)
|
||||
if response == "OK":
|
||||
print("Record deleted successfully.")
|
||||
else:
|
||||
print("Failed to delete record.")
|
||||
Reference in New Issue
Block a user