diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-09-16 12:27:11 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-09-16 12:27:11 +0300 |
commit | 376d68b0443a60a237e9e35462781a2ff504c7ac (patch) | |
tree | ea6457f797e35ea7288ee63c4301678c90247aa4 /system | |
parent | 86d08f80c0f9a8159139e29c070a87e55469fbc8 (diff) | |
download | swayrice-376d68b0443a60a237e9e35462781a2ff504c7ac.tar.gz swayrice-376d68b0443a60a237e9e35462781a2ff504c7ac.zip |
Config cleaning
* Removed unused stuff.
* Script for updating hosts file with latest unwanted domains.
* Other slight changes.
Diffstat (limited to 'system')
-rwxr-xr-x | system/update-hosts | 9 |
1 files changed, 9 insertions, 0 deletions
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 |