mdns-termux/bin/mdns-publish.py

24 lines
798 B
Python
Executable File

#!/data/data/com.termux/files/usr/bin/python3
"""mdns-publish.py: thin compat shim around `mdns publish`.
Kept for existing .bashrc aliases and users who linked to this filename.
New code should call `mdns publish [--config PATH]` directly.
"""
import os
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "lib"))
from mdns_tools.publish import run # noqa: E402
if __name__ == "__main__":
cfg = os.environ.get("MDNS_SERVICES_CONFIG")
if not cfg:
for candidate in (Path.home() / ".config" / "mdns" / "services.yaml",
Path.home() / ".config" / "mdns" / "services.json"):
if candidate.exists():
cfg = str(candidate)
break
run(config_path=cfg, verbose=True)