From 8865ff898e6dd8d23ec6eb8be538c98c05f938e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 4 Sep 2022 19:14:16 +0200 Subject: [PATCH] bind: use reload-or-restart --- hosts/bind/default.nix | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hosts/bind/default.nix b/hosts/bind/default.nix index fce44ab8..af6e3baf 100644 --- a/hosts/bind/default.nix +++ b/hosts/bind/default.nix @@ -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" ]; } ]; } ];