bind: use reload-or-restart

This commit is contained in:
Sandro - 2022-09-04 19:14:16 +02:00
parent f900ab3d94
commit 8865ff898e
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 2 additions and 9 deletions

View File

@ -2,8 +2,7 @@
let
systemctl = "${pkgs.systemd}/bin/systemctl";
deployCommand = "${systemctl} start deploy-c3d2-dns";
reloadCommand = "${systemctl} reload bind";
restartCommand = "${systemctl} restart bind";
reloadCommand = "${systemctl} reload-or-restart bind";
in
{
c3d2 = {
@ -124,10 +123,7 @@ in
# Take action
if systemctl is-active -q bind; then
/run/wrappers/bin/sudo ${reloadCommand}
MSG=reload
else
/run/wrappers/bin/sudo ${restartCommand}
MSG=restart
MSG=reload-or-restart
fi
if [ $? = 0 ]; then
@ -158,9 +154,6 @@ in
} {
command = reloadCommand;
options = [ "NOPASSWD" ];
} {
command = restartCommand;
options = [ "NOPASSWD" ];
} ];
} ];