Skip to content

Commit

Permalink
Add systemd unit to debian package (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
invliD committed Feb 24, 2024
1 parent 6a24a7e commit beefc8f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: matrix.os == 'linux'
uses: bpicode/github-action-fpm@master
with:
fpm_opts: -s dir -t deb -n mdns2mqtt -a ${{ matrix.arch }} -v ${{ steps.version.outputs.version }} mdns2mqtt=/usr/bin/mdns2mqtt
fpm_opts: -s dir -t deb -n mdns2mqtt -a ${{ matrix.arch }} -v ${{ steps.version.outputs.version }} --deb-default debian/mdns2mqtt --deb-systemd debian/mdns2mqtt.service mdns2mqtt=/usr/bin/mdns2mqtt
- name: Upload .deb package
uses: actions/upload-artifact@v4
if: matrix.os == 'linux'
Expand Down
14 changes: 14 additions & 0 deletions debian/mdns2mqtt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# The address of the MQTT broker to connect to
MQTT_ADDRESS=

# The credential to use when connecting to the MQTT broker
# MQTT_USERNAME=
# MQTT_PASSWORD=

# The MQTT topic to publish locally discovered MDNS services to. Local discovery is disabled if unset.
# MQTT_PUBLISH_TOPIC=
# The MQTT topic to subscribe to. MDNS services received on this topic will be locally announced.
# MQTT_SUBSCRIBE_TOPIC=

# The interface to listed on and publish MDNS announcements to
MDNS_INTERFACE=eth0
9 changes: 9 additions & 0 deletions debian/mdns2mqtt.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Service]
Type=simple
ExecStart=/usr/bin/mdns2mqtt
RestartSec=5s
Restart=always
EnvironmentFile=-/etc/default/mdns2mqtt

[Install]
WantedBy=multi-user.target

0 comments on commit beefc8f

Please sign in to comment.