Steps:
- Copy cron.d/freenom from repo to "/etc/cron.d/freenom"
- Edit file to specify domain(s)
0 9 * * 0 root bash -c 'sleep $((RANDOM \% 60))m; /usr/local/bin/freenom.sh -r -a'
0 * * * * root bash -c 'sleep $((RANDOM \% 15))m; /usr/local/bin/freenom.sh -u example.tk'
0 * * * * root bash -c 'sleep $((RANDOM \% 15))m; /usr/local/bin/freenom.sh -u example.tk -s mysubdom'
This first line in this example will run the script with "renew all domains" options every week on Sunday between 9.00 and 10.00
The second line updates the A record of example.tk
with the current client ip address, at hourly intervals
Add one or more "timer(s)"
Thanks to @sdcloudt you can use the template units from the systemd dir.
-
Copy files from repo to: "/lib/systemd/system"
-
Create a service instance for your domain(s) by creating symlinks (or use
systemctl enable
, see above) -
Reload systemd
# Create symlinks:
mkdir /path/to/systemd/timers.target.wants
ln -s /path/to/systemd/freenom-renew-all.service /etc/systemd/user/timers.target.wants/freenom-renew-all.service
ln -s /path/to/systemd/[email protected] /etc/systemd/user/timers.target.wants/[email protected]:
# (optional) to renew a specific domain, replace freenom-renew-all by:
ln -s /path/to/systemd/[email protected] /etc/systemd/user/timers.target.wants/[email protected]
# then reload systemd:
systemctl daemon-reload
In case of any errors make sure you're using the correct paths and "freenom.conf" is setup. Check systemctl status <unit>
and logs.