diff --git a/etc/systemd/system/update-ablock-hosts.service b/etc/systemd/system/update-ablock-hosts.service new file mode 100644 index 0000000..ba9dc40 --- /dev/null +++ b/etc/systemd/system/update-ablock-hosts.service @@ -0,0 +1,15 @@ +[Unit] +Description=Update adblock hosts from SetevenBlack list. +After=network-online.target + +[Service] +ExecStart=bash -c 'curl -so /etc/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts && resolvectl flush-caches' +StartLimitBurst=5 +StartLimitInterval=500 +Restart=on-failure +RestartSec=5s +KillMode=process +KillSignal=SIGINT + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/etc/systemd/system/update-ablock-hosts.timer b/etc/systemd/system/update-ablock-hosts.timer new file mode 100644 index 0000000..4491f89 --- /dev/null +++ b/etc/systemd/system/update-ablock-hosts.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Timer for updating StevenBlack hosts daily. + +[Timer] +OnBootSec=15s +OnUnitActiveSec=1d + +[Install] +WantedBy=timers.target \ No newline at end of file