Closed gaenserich closed 7 years ago
I think sudo
is the best method. Using su
at one point of the code is nice too, just to let the users know that they are changing something that is important.
I will work on this in the future
branch, what I will do in order (probably):
dnsmasq
configuration is changed optionallySounds great! Maybe when simplifying the code into a single script you could also address the issue I've raised about checking the online sources for any changes first, and then going ahead with updating those with changes (e.g. 2 separate functions)
@Sadi58 I will, just leave it to me, the code is a bit long too, need to shorten it a bit.
@gaenserich When I am reading the code, I found all those debugging info very annoying, by the way, can I just remove those extra useless code? It is a lot easier to debug with set -x
.
And I will remove those lines which aren't really needed so hostsblock
can be really runned as a script.
But I will work on this in the future
branch.
Feel free to start a branch (1.1 ?) for your debugging clean ups.
What precisely do you mean by "running as a script"?: -Remove "source" calls to hostsblock-common.sh? I'm all for simplification, but moving the functions in hostsblock-common.sh will actually lead to additional duplication between hostsblock.sh and hostsblock-urlcheck.sh (they both have certain functions in common) -Be able to run the script directly from the command line? That you can already do as root (you don't have to run it via systemd or cron. -Run it just as "hostsblock.sh" instead of "hostsblock"? There's not substantive difference between the two.
Yeah, I mean to use only one script for everything with the support of running uninteractively (cronjob-friendly).
hostsblock is already cronjob friendly. Just configure hostsblock.conf and enter it into the crontab or symlink it into your cron.daily directory or the like.
Or did you mean that hostsblock-urlcheck should also be included into the main script?
Yeah, I would like to include hostsblock-urlcheck in the main script too.
Yeah, I would like to include hostsblock-urlcheck in the main script too.
Let's look how the guys behind Yaourt did it maybe we can Learn something.
Fixed. Now uses user "hostsblock", and possible to (in the future) secure it down further using chroot. a28f19ca79caed605bb6f690a4214cdd543c398e
Instead of having all of hostsblock run as root, have only the needed processes do so, e.g.
Will sudo work for these other situations, or is there another method?