Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostsblock failed if white.list or black.list file doesn't exist #99

Open
jmbIFR opened this issue Oct 22, 2019 · 1 comment
Open

hostsblock failed if white.list or black.list file doesn't exist #99

jmbIFR opened this issue Oct 22, 2019 · 1 comment

Comments

@jmbIFR
Copy link

jmbIFR commented Oct 22, 2019

At first run, after install, the grep command in hostsblock.sh failled because the white.list doesn't exist

the log (in french) give

  Extracting blocklists...
grep: /var/lib/hostsblock/white.list: Aucun fichier ou dossier de ce type
grep: erreur d'écriture: Relais brisé (pipe)
sort: échec d'écriture: 'sortie standard': Relais brisé (pipe)
sort: erreur d'écriture
FAILED TO COMPILE BLOCK/REDIRECT ENTRIES FROM URLS IN /var/lib/hostsblock/block.urls INTO /var/lib/hostsblock/hosts.block. EXITING

If $blacklist file doesn't exist, the input redirection form $blacklist fail (show log below) and In the end the hosts.block is not created

while read _blacklistline; do
    grep -Fqx "$redirecturl $_blacklistline" "$hostsfile".new || \
      printf %s\\n "$redirecturl $_blacklistline" >> "$hostsfile".new
done < "$blacklist" && \
mv $_v -- "$hostsfile".new "$hostsfile" && \ ICIC
chmod 644 "$hostsfile"
/usr/lib/hostsblock.sh: 680: /usr/lib/hostsblock.sh: cannot open /var/lib/hostsblock/black.list: No such file
@jmbIFR jmbIFR changed the title hostsblock failed if white.list file doesn't exist hostsblock failed if white.list or black.list file doesn't exist Oct 22, 2019
@jakevanderkolk
Copy link

Thank you for the submission, and your patience. It's been a long pandemic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants