/opt/tier1adv/bin
NameSizeModeActions
adddomainkey11790755editdlrm
addlocaldomain22810755editdlrm
addspf38450755editdlrm
baksync207180700editdlrm
build_maxemails_config11690755editdlrm
checkip43000755editdlrm
chpass33360755editdlrm
create_db14210755editdlrm
dcv24270755editdlrm
downchk46030755editdlrm
editquota35120755editdlrm
exim_tidydb30360755editdlrm
ipusage76240755editdlrm
mysqlconnectioncheck68770755editdlrm
proxydomains98220755editdlrm
rmdomainkey11820755editdlrm
rmlocaldomain22810755editdlrm
rmpwb21230755editdlrm
rmspf9100755editdlrm
runweblogs10450755editdlrm
sdig198450755editdlrm
server_overview207810755editdlrm
simpleps31240755editdlrm
switch20300755editdlrm
unblock27960755editdlrm
updateuserdomains7740755editdlrm
usernano7830755editdlrm
validate_zone11100755editdlrm
whoowns11550755editdlrm
Edit: /opt/tier1adv/bin/validate_zone (1110B)
#!/opt/support/venv/bin/python3 import argparse import sys from pathlib import Path import subprocess from rads.color import green sys.path.insert(0, '/opt/support/lib') from arg_types import valid_domain from output import err_exit def get_args() -> str: """Parse domain from command arguments""" parser = argparse.ArgumentParser() parser.add_argument('domain', type=valid_domain, help='domain to check') return parser.parse_args().domain def main(): domain = get_args() zone_file = Path('/var/named', f"{domain}.db") if zone_file.is_file(): print(green(f'Zone File exists at {zone_file}')) else: err_exit(f'Zone file does not exist at {zone_file}') try: ret_code = subprocess.call(['named-checkzone', domain, str(zone_file)]) except FileNotFoundError as exc: # named-checkzone is missing err_exit(str(exc)) if ret_code: # non-zero return code err_exit(f'Failed to validate the zone file at {zone_file}') print(green(f'Successfully validated the zone file at {zone_file}')) if __name__ == "__main__": main()