Usage and docs update
This commit is contained in:
parent
af4051dfbe
commit
b7ca669b3a
@ -4,6 +4,10 @@ The Host Blocker command.
|
|||||||
|
|
||||||
This is a system utility written in C that allows one to quickly black hole hosts in the /etc/hosts file, keeping one from resolving any DNS for those hosts and permanently blocking them on the system.
|
This is a system utility written in C that allows one to quickly black hole hosts in the /etc/hosts file, keeping one from resolving any DNS for those hosts and permanently blocking them on the system.
|
||||||
|
|
||||||
|
# How it Works
|
||||||
|
|
||||||
|
The program will wake up in a configurable timeframe continuously, reading a config file into memory and making appropriate changes to the /etc/hosts based on what it reads from the config.
|
||||||
|
|
||||||
# Motivations
|
# Motivations
|
||||||
|
|
||||||
I would like to get better with C, and will be using C much more in the near future. In addition, I have issues with browsing to sites that hurt my productivity and am always on the command line.
|
I would like to get better with C, and will be using C much more in the near future. In addition, I have issues with browsing to sites that hurt my productivity and am always on the command line.
|
||||||
|
18
main.c
18
main.c
@ -63,14 +63,6 @@ void blockHost(char *host)
|
|||||||
fclose(hostsFile);
|
fclose(hostsFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void usage()
|
|
||||||
{
|
|
||||||
fprintf(stdout, "Usage: ");
|
|
||||||
fprintf(stdout, "hb [add] <sitename>\n");
|
|
||||||
fprintf(stdout, "hb [edit] <oldsite> <newsite>\n");
|
|
||||||
fprintf(stdout, "hb [show]\n");
|
|
||||||
fprintf(stdout, "hb [delete] <sitename>\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void showHosts()
|
void showHosts()
|
||||||
{
|
{
|
||||||
@ -177,6 +169,16 @@ void run_loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void usage()
|
||||||
|
{
|
||||||
|
fprintf(stdout, "Usage: ");
|
||||||
|
fprintf(stdout, "hb [add] <sitename>\n");
|
||||||
|
fprintf(stdout, "hb [edit] <oldsite> <newsite>\n");
|
||||||
|
fprintf(stdout, "hb [show]\n");
|
||||||
|
fprintf(stdout, "hb [delete] <sitename>\n");
|
||||||
|
fprintf(stdout, "hb -period <wakeup period> -config <config file> -daemon\n");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entrypoint.
|
* Entrypoint.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user