gaenserich / hostsblock

an ad- and malware-blocking script for Linux
https://github.com/gaenserich/hostsblock
225 stars 28 forks source link

Integer expression expected #73

Closed Hjdskes closed 6 years ago

Hjdskes commented 7 years ago

Hi,

I just updated to the latest version of hostsblock and have changed my configuration accordingly, i.e. my configuration file is now in /var/lib/hostsblock/hostsblock.conf as are my hosts.head and white- and blocklist. I am using the hostshead option to, as advertised, place my original hosts file in the beginning of the overwritten hosts file. When I run hostsblock, I get this:

 > sudo -u hostsblock hostsblock
Checking blocklists for updates...
Changes found to http://support.it-mate.co.uk/downloads/HOSTS.txt
Changes found among blocklists. Extracting and preparing cached files to working directory...
/usr/bin/hostsblock: line 461: [: /var/lib/hostsblock/hosts.head: integer expression expected
Compiling into /var/lib/hostsblock/hosts.block...
Executing postprocessing...
/var/lib/hostsblock/hosts.block: 766213 urls redirected to 127.0.0.1.
/var/lib/hostsblock/hosts.block: 1 urls redirected to 127.0.0.1 localhost.localdomain   localhost.

Here is the relevant part from my config, with the addition to /etc/sudoers made:

postprocess() {
    sudo cp $_v $hostsfile /etc/hosts
}

hostshead="$HOME/hosts.head"

Let me know if there is anything else you need.

gaenserich commented 7 years ago

This is a known (https://github.com/gaenserich/hostsblock/issues/69) "issue". I use quotes because it's annoying, but doesn't affect anything, and probably won't get fixed until the next release.