forked from c3d2/nix-config
bind: use reload-or-restart
This commit is contained in:
parent
f900ab3d94
commit
8865ff898e
|
@ -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" ];
|
|
||||||
} ];
|
} ];
|
||||||
} ];
|
} ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user