Skip to content

Instantly share code, notes, and snippets.

@coreyoconnor
Created March 19, 2018 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreyoconnor/776f64f43b7a7ea7bc7a1435dcefb7f6 to your computer and use it in GitHub Desktop.
Save coreyoconnor/776f64f43b7a7ea7bc7a1435dcefb7f6 to your computer and use it in GitHub Desktop.
{config, pkgs, lib, ...}:
with lib;
{
systemd.services.update-freemyip =
{
description = "Updates FreeMyIP";
path = [ pkgs.curl ];
serviceConfig =
{
Type = "oneshot";
User = "nobody";
};
script = ''
set -ex
curl https://freemyip.com/update?token=$TOKEN
'';
};
systemd.timers.update-freemyip =
{
wantedBy = [ "timers.target" ];
timerConfig =
{
OnCalendar = "*:0/30";
Persistent = "yes";
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment