block
block copied to clipboard
[Request] Include this systemd service
I wrote a simple systemd service that updates the hosts file weekly. It would be useful for Linux users if it was included in the documentation.
/usr/lib/systemd/system/update-hosts.service
[Unit]
Description=Update the hosts file
Documentation=https://github.com/EnergizedProtection/block
[Service]
Type=oneshot
ExecStartPre=wget https://block.energized.pro/unified/formats/hosts -O /tmp/hosts.tmp
ExecStart=mv /tmp/hosts.tmp /etc/hosts
ExecStartPost=rm -rf /tmp/hosts.tmp
[Install]
WantedBy=multi-user.target
/usr/lib/systemd/system/update-hosts.timer
[Unit]
Description=Update the hosts file weekly
[Timer]
OnCalendar=weekly
AccuracySec=1h
Persistent=true
RandomizedDelaySec=100min
[Install]
WantedBy=timers.target