Skip to content

Instantly share code, notes, and snippets.

@andyfangdz
Created May 31, 2021 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyfangdz/993d438a30ca962b8d24e5cf318f3e63 to your computer and use it in GitHub Desktop.
Save andyfangdz/993d438a30ca962b8d24e5cf318f3e63 to your computer and use it in GitHub Desktop.
mdns-publish-cname@.service
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# mdns-publish-cname - Publish CNAMEs pointing to the local host over Avahi/mDNS.
#
# Copyright (c) 2018, Carlos Rodrigues
#
from mpublisher import cname_service as command
if __name__ == "__main__":
command.main()
# vim: set expandtab ts=4 sw=4:
# ❯ cat /etc/systemd/system/mdns-publish-cname@.service
[Unit]
Description=Publish %I as CNAME via Avahi/mDNS CNAME publisher
After=network.target avahi-daemon.service
[Service]
User=nobody
Group=nobody
Type=simple
WorkingDirectory=/var/empty
EnvironmentFile=-/etc/default/mdns-publish-cname
ExecStart=/usr/bin/mdns-publish-cname --ttl 20 %i
Restart=no
PrivateTmp=true
PrivateDevices=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment