Files
syno-scripts/HOMELAB/home-assistant/ha-dns-gateway.sh
T
2026-10-15 12:21:26 +02:00

22 lines
680 B
Bash

#!/bin/sh
# Install on DSM as root-owned /usr/local/sbin/ha-dns-gateway.sh.
# Only used as the forced command of the dedicated Home Assistant SSH key.
set -eu
case "${SSH_ORIGINAL_COMMAND:-}" in
check-dns)
test -x /usr/syno/bin/synopkg
test -d /var/packages/DNSServer
sudo -n -l /usr/syno/bin/synopkg restart DNSServer >/dev/null
printf '%s\n' 'DNS-Paket und sudo-Regel vorhanden. Kein Neustart ausgeführt.'
;;
restart-dns)
test -x /usr/syno/bin/synopkg
test -d /var/packages/DNSServer
exec sudo -n /usr/syno/bin/synopkg restart DNSServer
;;
*)
printf '%s\n' 'Nur check-dns oder restart-dns ist erlaubt.' >&2
exit 64
;;
esac