diff --git a/configuration.org b/configuration.org index 11e4a49..34311b2 100755 --- a/configuration.org +++ b/configuration.org @@ -1111,6 +1111,22 @@ systemd.user.services = { ExecStart = "${jawz_tasks}/bin/tasks"; }; }; + "update_dns" = let jawz_update_dns = pkgs.writeScriptBin + "update_dns" (builtins.readFile ./scripts/update_dns.sh); in { + restartIfChanged = true; + description = "update DNS of my websites"; + wantedBy = [ "default.target" ]; + path = [ + pkgs.curl + pkgs.bash + jawz_update_dns + ]; + serviceConfig = { + Restart = "on-failure"; + RestartSec = 30; + ExecStart = "${jawz_update_dns}/bin/update_dns"; + }; + }; }; systemd.user.timers = { "tasks" = { @@ -1121,6 +1137,15 @@ systemd.user.timers = { OnCalendar = "*:0/10"; }; }; + "update_dns" = { + enable = true; + description = "update DNS of my websites"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = "1min"; + OnUnitActiveSec = "6h"; + }; + }; }; #+end_src