-
Notifications
You must be signed in to change notification settings - Fork 28
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
Error in hostsblock on Ubuntu #69
Comments
That appears to be bash complaining. The line in question is:
```sh
if [ "$hostshead" == "0" ] || [ $hostshead -eq 0 ]; then
```
Which is written to cover assertions from hostsblock.conf à la hostshead=0
(i.e. as an integer) and hostshead="0" (i.e. as a string). I'm sure there
is a better way to write that, but for now, other than the complaining
stderr, it works as intended.
Try replacing the line with this:
```sh
if [[ "$hostshead" == "0" || $hostshead -eq 0 ]]; then
```
and see if it gets rid of the stderr complaint.
|
Thanks for the hint. I couldn't get rid of the stderr using your suggested change. But as I always use the hosthead functionality I got away with: if [ "$hostshead" == 0 ]; then |
I've run into a few issues with shell scripts. Shellcheck is a good resource to help refine/fix any naggling issues. I'd offer to push my "fixed" scripts, but I'm not sure if this would have any negative effect on other distros. I'm using Ubuntu 16.04 |
I'll check shellcheck out. Were there any specific issues you ran into,
e.g. specific error messages?
Jacob A. van der Kolk, Ph.D. <http://personal.psu.edu/jav209>
Visiting Instructor of German
Kalamazoo College
[email protected] (PGP Public Key
<http://personal.psu.edu/jav209/jakevanderkolk_protonmail.asc>)
2018-04-04 18:33 GMT-04:00 Mitchell Freiderich <[email protected]>:
… I've run into a few issues with shell scripts. Shellcheck
<https://github.com/koalaman/shellcheck> is a good resource to help
refine/fix any naggling issues. I'd offer to push my "fixed" scripts, but
I'm not sure if this would have any negative effect on other distros. I'm
using Ubuntu 16.04
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACHno-NPbI_ym5ibYY-9II-8qop8eQX4ks5tlUongaJpZM4OmDv4>
.
|
Here's the output of shellcheck on "install.sh" of the master branch: In install.sh line 11: In install.sh line 22: In install.sh line 32: In install.sh line 49: In install.sh line 50: In install.sh line 60: Here's the output of running "sudo ./install.sh" without modifications: getent utility missing. Please install before running this script. Exiting... Here's the output of the same command after fixing only the first warning: Destination directory for hostsblock is /usr/bin/. Enter a new path or press Enter to keep as is. jake ALL = (hostsblock) NOPASSWD: /hostsblock,/hostsblock-urlcheck where 'jake' is the user from which you want to manage hostsblock. I hope this helps |
Hi, using latest hostsblock on Ubuntu returns an error. The same version on Archlinux does not. Seems not critical, hosts.block is updated as expected.
Ubuntu 16.04.2 LTS
$ sudo systemctl start hostsblock
$ systemctl status hostsblock
...
Jul 28 04:14:44 crow16 hostsblock[8448]: /usr/bin/hostsblock: line 442: [: /var/lib/hostsblock/hosts.head: integer expression expected
...
Regards
The text was updated successfully, but these errors were encountered: