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

View File

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