bind: use reload-or-restart
This commit is contained in:
parent
f900ab3d94
commit
8865ff898e
|
@ -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" ];
|
||||
} ];
|
||||
} ];
|
||||
|
||||
|
|
Loading…
Reference in New Issue