Update
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# Nach /config/packages/synology_dns.yaml kopieren.
|
||||
shell_command:
|
||||
synology_dns_restart: >-
|
||||
ssh -F /dev/null -T -p 22
|
||||
-i /config/ssh/synology_dns_ed25519
|
||||
-o BatchMode=yes -o IdentitiesOnly=yes
|
||||
-o StrictHostKeyChecking=yes
|
||||
-o UserKnownHostsFile=/config/ssh/synology_dns_known_hosts
|
||||
-o ConnectTimeout=10 -o ServerAliveInterval=5 -o ServerAliveCountMax=2
|
||||
Madzone@192.168.1.230 restart-dns
|
||||
|
||||
script:
|
||||
synology_dns_restart:
|
||||
alias: Synology · DNS Server neu starten
|
||||
icon: mdi:dns
|
||||
mode: single
|
||||
sequence:
|
||||
- action: persistent_notification.create
|
||||
data:
|
||||
notification_id: synology_dns_restart
|
||||
title: Synology DNS Server
|
||||
message: Neustartbefehl wird gesendet …
|
||||
- variables:
|
||||
dns_result:
|
||||
returncode: -1
|
||||
- action: shell_command.synology_dns_restart
|
||||
response_variable: dns_result
|
||||
continue_on_error: true
|
||||
- choose:
|
||||
- conditions: "{{ dns_result is defined and dns_result is mapping and dns_result.get('returncode', -1) == 0 }}"
|
||||
sequence:
|
||||
- action: persistent_notification.create
|
||||
data:
|
||||
notification_id: synology_dns_restart
|
||||
title: Synology DNS Server
|
||||
message: >-
|
||||
Der DNS-Neustartbefehl wurde erfolgreich ausgeführt.
|
||||
Das NAS wurde nicht neu gestartet. Die DNS-Auflösung wurde nicht separat geprüft.
|
||||
default:
|
||||
- action: persistent_notification.create
|
||||
data:
|
||||
notification_id: synology_dns_restart
|
||||
title: Synology DNS · Neustart nicht bestätigt
|
||||
message: >-
|
||||
SSH oder der Neustartbefehl ist fehlgeschlagen, oder das Zeitlimit wurde erreicht.
|
||||
Prüfe den DNS-Paketstatus in DSM und das Home-Assistant-Protokoll,
|
||||
bevor du einen weiteren Neustart auslöst.
|
||||
- delay: '00:01:00'
|
||||
Reference in New Issue
Block a user