From 376d68b0443a60a237e9e35462781a2ff504c7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 16 Sep 2021 12:27:11 +0300 Subject: Config cleaning * Removed unused stuff. * Script for updating hosts file with latest unwanted domains. * Other slight changes. --- system/update-hosts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 system/update-hosts (limited to 'system/update-hosts') diff --git a/system/update-hosts b/system/update-hosts new file mode 100755 index 0000000..6725ce9 --- /dev/null +++ b/system/update-hosts @@ -0,0 +1,9 @@ +#!/bin/sh + +# Check several times before giving up, useful when just waking up from sleep +# since internet is usually not available right away +wget -q --tries=3 --timeout=20 --spider 1.1.1.1 > /dev/null || exit + +curl "http://sbc.io/hosts/hosts" 2>/dev/null | \ + grep -vE '^(\s*)[1-9a-f:]{1,4}.*' | \ + cat /etc/hosts.head - > /etc/hosts -- cgit v1.2.3