created script for updating dynamic dns

This commit is contained in:
Danilo Reyes 2023-09-02 13:27:16 -06:00
parent 30fb6ac0bf
commit bd54541220

View File

@ -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