Prevent nify-failure from calling itself
Some checks failed
Check Flake / check-flake (push) Failing after 4m13s
Some checks failed
Check Flake / check-flake (push) Failing after 4m13s
This commit is contained in:
@@ -14,6 +14,8 @@ in
|
|||||||
EnvironmentFile = "/run/agenix/ntfy-token";
|
EnvironmentFile = "/run/agenix/ntfy-token";
|
||||||
ExecStart = "${pkgs.writeShellScript "ntfy-failure-notify" ''
|
ExecStart = "${pkgs.writeShellScript "ntfy-failure-notify" ''
|
||||||
unit="$1"
|
unit="$1"
|
||||||
|
# Prevent infinite recursion if this service itself fails
|
||||||
|
[[ "$unit" == ntfy-failure@* ]] && exit 0
|
||||||
ignored_units=(${lib.concatMapStringsSep " " (u: lib.escapeShellArg u) cfg.ignoredUnits})
|
ignored_units=(${lib.concatMapStringsSep " " (u: lib.escapeShellArg u) cfg.ignoredUnits})
|
||||||
for ignored in "''${ignored_units[@]}"; do
|
for ignored in "''${ignored_units[@]}"; do
|
||||||
if [[ "$unit" == "$ignored" ]]; then
|
if [[ "$unit" == "$ignored" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user