e31bdeb59d
- inwx_common.py: Login mit Session-Cache, KP_PW-Option - inwx_list/add: Domain als Argument, gemeinsamer Helfer - inwx_domains(_owner).py: Domains alphabetisch, NS, Gruppen via citeq-TXT (DNS) - hosting.kdbx aus Tracking genommen und in .gitignore Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
import os
|
|
import sys
|
|
|
|
from inwx_common import get_client, call_api
|
|
|
|
# --- KONFIGURATION ---
|
|
# Login/Session-Handling steckt in inwx_common.py.
|
|
|
|
|
|
def main():
|
|
# Domain als Argument einlesen
|
|
if len(sys.argv) < 2:
|
|
script = os.path.basename(sys.argv[0])
|
|
print(f"Verwendung: {script} <domain>")
|
|
print(f"Beispiel: {script} ma151.de")
|
|
sys.exit(1)
|
|
|
|
domain = sys.argv[1]
|
|
|
|
# Holt einen einsatzbereiten Client (nutzt ggf. die zwischengespeicherte Session)
|
|
api = get_client()
|
|
|
|
print(f"Rufe Records für {domain} ab...")
|
|
try:
|
|
res = call_api(api, 'nameserver.info', {'domain': domain})
|
|
|
|
if res['code'] == 1000:
|
|
records = res['resData']['record']
|
|
print(f"\n{'TYP':<8} {'NAME':<35} {'WERT'}")
|
|
print("-" * 75)
|
|
for rec in records:
|
|
print(f"{rec['type']:<8} {rec['name']:<35} {rec['content']}")
|
|
else:
|
|
print(f"❌ API Fehler: {res['msg']} (Code: {res['code']})")
|
|
|
|
except Exception as e:
|
|
print(f"❌ Fehler beim Abruf mit call_api: {e}")
|
|
|
|
# Kein logout() -> die Session bleibt gültig und kann wiederverwendet werden.
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|