Hacker News new | ask | show | jobs
by JonChesterfield 721 days ago
Simple enough to write inline.

There's a file called DNS.md which contains lines like `192.168.1.15 milan` in an obsidian vault. Obsidian sync copies it around. DNS is by pihole which uses a plain text file in that sort of format for the entries.

Then superuser's crontab -l

    0 * * * * cmp /home/jon/Documents/Obsidian/SystemControl/DNS.md  /etc/pihole/custom.list >/dev/null 2>&1 || cat /home/jon/Documents/Obsidian/SystemControl/DNS.md > /etc/pihole/custom.list && sudo -u jon pihole restartdns
Cron has rules about relative paths that I don't remember so it's literally written as above.

It seems likely that the idea generalises. I'm considering managing public keys for ssh / wireguard in similar fashion but haven't done so yet.