From ef17f4913b5444965138179443bbfab2bac30fa2 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 09:39:51 +1000 Subject: [PATCH 01/12] Create pihole.8 Linux man page for pihole Signed-off-by: Rob Gill --- pihole.8 | 326 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 326 insertions(+) create mode 100644 pihole.8 diff --git a/pihole.8 b/pihole.8 new file mode 100644 index 00000000..d62dbf8a --- /dev/null +++ b/pihole.8 @@ -0,0 +1,326 @@ +.TH "Pi-hole" "8" "Pi-hole" "Pi-hole" "May 2018" +.SH "NAME" + +Pi-hole : A black-hole for internet advertisements +.br +.SH "SYNOPSIS" + +\fBpihole\fR (\fB-w\fR|\fB-b\fR|\fB-wild\fR) [options] domain(s) +.br +\fBpihole -a\fR \fB-p\fR password +.br +\fBpihole -a\fR (-c|-f|-k) +.br +\fBpihole -a\fR [\fB-r\fR hostrecord] +.br +\fBpihole -a -e\fR email +.br +\fBpihole -a -i\fR interface +.br +\fBpihole -a -l\fR privacylevel +.br +\fBpihole -c\fR [-j|-r|-e] +.br +\fBpihole\fR \fB-d\fR [-a] +.br +\fBpihole -f +.br +pihole -r +.br +pihole -t +.br +pihole -g\fR +.br +\fBpihole\fR -\fBq\fR [options] +.br +\fBpihole\fR \fB-l\fR (on|off|off noflush) +.br +\fBpihole -up \fR[--checkonly] +.br +\fBpihole uninstall +.br +pihole status +.br +pihole restartdns\fR +.br +\fBpihole\fR (\fBenable\fR|\fBdisable\fR [time]) +.br +\fBpihole\fR \fBcheckout\fR repo [branch] +.br +\fBpihole\fR \fBhelp\fR +.br +.SH "DESCRIPTION" + +Available commands and options: +.br + +\fB-w, whitelist\fR [options] [ ] +.br + Adds or removes specified domain or domains tho the Whitelist +.br + +\fB-b, blacklist\fR [options] [ ] +.br + Adds or removes specified domain or domains to the blacklist +.br + +\fB-wild, wildcard\fR [options] [ ] +.br + Add or removes specified domain, and all subdomains to the blacklist +.br + +.br + (Whitelist/Blacklist manipulation options): +.br + -d, --delmode Remove domain(s) from the list +.br + -nr, --noreload Update list without refreshing dnsmasq +.br + -q, --quiet Make output less verbose +.br + -l, --list Display all your listed domains +.br + --nuke Removes all entries in a list +.br + +\fB-d, debug\fR [\fB-a\fR] +.br + Start a debugging session Add '-a' to enable automated debugging +.br + +\fB-f, flush\fR +.br + Flush the Pi-hole log +.br + +.br +\fB-r, reconfigure\fR +.br + Reconfigure or Repair Pi-hole subsystems +.br + +\fB-t, tail\fR +.br + View the live output of the Pi-hole log +.br + +\fB-a, admin\fR [options] Console +.br + +.br + (Admin console options): +.br + -p, password Set Admin Console password +.br + -c, celsius Set Celsius as preferred temperature unit +.br + -f, fahrenheit Set Fahrenheit as preferred temperature unit +.br + -k, kelvin Set Kelvin as preferred temperature unit +.br + -r, hostrecord Add a name to the DNS associated to an IPv4/IPv6 address +.br + -e, email Set an administrative contact address for the Block Page +.br + -i, interface Specify dnsmasq's interface listening behavior +.br + -l, privacylevel Set privacy level (0 = lowest, 3 = highest) +.br + +.br +\fB-c, chronometer\fR [options] +.br + Calculates stats and displays to an LCD +.br + + (Chronometer Options): +.br + -j, --json Output stats as JSON formatted string +.br + -r, --refresh Set update frequency (in seconds) +.br + -e, --exit Output stats and exit witout refreshing +.br + +\fB-g, updateGravity\fR +.br + Update the list of ad-serving domains +.br + +\fB-q, query\fR [option] +.br + Query the adlists for a specified domain +.br + + (Query options): +.br + -adlist Print the name of the block list URL +.br + -exact Search the block lists for exact domain matches +.br + -all Return all query matches within a block list +.br + +\fB-h, --help, help\fR +.br + Show a help dialog +.br + +\fB-l, logging\fR [on|off|off noflush] +.br + Specify whether the Pi-hole log should be used +.br + + (Logging options): +.br + on Enable the Pi-hole log at /var/log/pihole.log +.br + off Disable and flush the Pi-hole log at /var/log/pihole.log +.br + off noflush Disable the Pi-hole log at /var/log/pihole.log +.br + +.br +\fB-up, updat\fBe\fR\fR\fBPihole\fR [--check-only] +.br + Update Pi-hole subsystems +.br + Add '--check-only' to exit script before update is performed. +.br + +\fB-v, version\fR [repo] [options] +.br + Show installed versions of Pi-hole, Admin Console & FTL +.br + +.br + (repo options): +.br + -p, --pihole Only retrieve info regarding Pi-hole repository +.br + -a, --admin Only retrieve info regarding AdminLTE repository +.br + -f, --ftl Only retrieve info regarding FTL repository +.br + (version options): +.br + -c, --current Return the current version +.br + -l, --latest Return the latest version +.br + --hash Return the Github hash from your local repositories +.br + +\fBuninstall\fR +.br + Uninstall Pi-hole from your system +.br + +\fBstatus\fR +.br + Display the running status of Pi-hole subsystems +.br + +\fBenable\fR +.br + Enable Pi-hole subsystems +.br + +\fBdisable\fR [time] +.br + Disable Pi-hole subsystems, optionally for a set duration +.br + +.br + (time options): +.br + #s Disable Pi-hole functionality for # second(s) +.br + #m Disable Pi-hole functionality for # minute(s) +.br + +\fBrestartdns\fR +.br + Restart Pi-hole subsystems +.br + +\fBcheckout\fR [repo][branch] +.br + Switch Pi-hole subsystems to a different Github branch +.br + + (repo options): +.br + core Change the branch of Pi-hole's core subsystem +.br + web Change the branch of Admin Console subsystem +.br + ftl Change the branch of Pi-hole's FTL subsystem +.br + (branch options): +.br + master Update subsystems to the latest stable release +.br + dev Update subsystems to the latest development release +.br + +.SH "EXAMPLE" +Some usage examples +.br + + Whitelist/blacklist manipulation +.br + + \fBpihole -w iloveads.example.com\fR Add "iloveads.example.com" to whitelist +.br + \fBpihole -b -d noads.example.com\fR Remove "noads.example.com" from blacklist +.br + \fBpihole -wild ads.example\fR Add "ads.example" as wildcard - would block ads.example.net +.br + + Changing the web ui password +.br + +.br + \fBpihole -a -p ExamplePassword\fR Change the password to "ExamplePassword" +.br + + Updating lists from internet sources +.br + +.br + \fBpihole -g\fR Update the list of ad-serving domains +.br + + Displaying version information +.br + +.br + \fBpihole -v -c\fR Display the current version of AdminLTE +.br + +.br + Temporarily disabling Pi-hole +.br + +.br + \fBpihole disable 5m\fR Disable Pi-hole functionality for five minutes +.br + +.br + Switching Pi-hole subsystem branches +.br + +.br + \fBpihole checkout master\fR Switch to master branch +.br + \fBpihole checkout core dev\fR Switch to core development branch +.br +.SH "SEE ALSO" + +dmasq(8), lighttpd(8) +.br +.SH "COLOPHON" + +Get sucked into the latest news and community activity by entering Pi-hole's orbit. Information about Pi-hole, and the latest version of the software can be found at https://pi-hole.net. +.br From a8103ca22d1c3de39376809e97f07bff6ba23584 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 09:45:04 +1000 Subject: [PATCH 02/12] Manual page install function Function to install man page. Verifies that man pages are installed, and correct directory for the pihole manpage is present. Copies file, and runs man-db to update man page database. Signed-off-by: Rob Gill --- automated install/basic-install.sh | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 43d4b7c2..9b5fde8e 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1193,6 +1193,37 @@ installConfigs() { fi } +install_manpage() { + # Copy Pi-hole man page and call mandb to update man page database + # Default location for man files for /usr/local/bin is /usr/local/share/man + # on lightweight systems may not be present, so check before copying. + echo -en " ${INFO} Testing man page installation" + if ! command -v mandb; then + # if mandb is not present, no manpage support + echo -e "${OVER} ${INFO} man not installed" + return + elif [[ ! -d "/usr/local/share/man" ]]; then + # appropriate directory for Pi-hole's man page is not present + echo -e "${OVER} ${INFO} man page not installed" + return + elif [[ ! -d "/usr/local/share/man/man8"]]; then + # if not present, create man8 directory + mkdir /usr/local/share/man/man8 + fi + # Testing complete, copy the file & update the man db + cp ${PI_HOLE_LOCAL_REPO}/pihole.8 /usr/local/share/man/man8/pihole.8 + if mandb -q &>/dev/null; then + # Updated successfully + echo -e "${OVER} ${TICK} man page installed and database updated" + return + else + # Something is wrong with the system's man installation, clean up + # our file, (leave everything how we found it). + rm /usr/local/share/man/man8/pihole.8 + echo -e "${OVER} ${INFO} man page db not updated, man page not installed" + fi +} + stop_service() { # Stop service passed in as argument. # Can softfail, as process may not be installed when this is called @@ -1695,6 +1726,9 @@ installPihole() { configureFirewall fi + # install a man page entry for pihole + install_manpage + # Update setupvars.conf with any variables that may or may not have been changed during the install finalExports } From 999e47a26c28c627836c4b8dd4ea56f8f29f8f80 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 09:50:52 +1000 Subject: [PATCH 03/12] Remove manual page Tests for presence of pihole man page. If it is present, deletes it and runs man-db to rebuild manual database. Signed-off-by: Rob Gill --- automated install/uninstall.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 0a51fd4a..4525f42f 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -171,6 +171,13 @@ removeNoPurge() { echo -e "${OVER} ${TICK} Removed pihole-FTL" fi + # If the pihole manpage exists, then delete and rebuild man-db + if [[ -f /usr/local/share/man/man8/pihole.8 ]]; then + ${SUDO} rm -f /usr/local/share/man/man8/pihole.8 + ${SUDO} mandb -q &>/dev/null + echo -e " ${TICK} Removed pihole man page" + fi + # If the pihole user exists, then remove if id "pihole" &> /dev/null; then if ${SUDO} userdel -r pihole 2> /dev/null; then From a8f0283e93ba8d7dd3ea4cfb6d4361c9523d0d4d Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 10:11:11 +1000 Subject: [PATCH 04/12] Update basic-install.sh This hands checking of lighttpd's status over to the existing check_service_active() function. All other checks of service status within the install script are handled by this function. Use of existing function: Avoids duplication of service detection logic. Uses return code to determine status, thereby avoids parsing text to determine status, and reliance on English language locale to determine activity, (which may also be broken on some systems (# 2204) Signed-off-by: Rob Gill --- automated install/basic-install.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 43d4b7c2..fcc66fe1 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2290,15 +2290,13 @@ main() { if [[ "${INSTALL_WEB_SERVER}" == true ]]; then enable_service lighttpd fi - - if [[ -x "$(command -v systemctl)" ]]; then - # Value will either be 1, if true, or 0 - LIGHTTPD_ENABLED=$(systemctl is-enabled lighttpd | grep -c 'enabled' || true) - else - # Value will either be 1, if true, or 0 - LIGHTTPD_ENABLED=$(service lighttpd status | awk '/Loaded:/ {print $0}' | grep -c 'enabled' || true) + # Determin if lighttpd is correctly enabled + if check_service_active "lighttpd"; then + LIGHTTPD_ENABLED=true; + else + LIGHTTPD_ENABLED=false; fi - + # Install and log everything to a file installPihole | tee -a /proc/$$/fd/3 @@ -2327,7 +2325,7 @@ main() { # If the Web server was installed, if [[ "${INSTALL_WEB_SERVER}" == true ]]; then - if [[ "${LIGHTTPD_ENABLED}" == "1" ]]; then + if [[ "${LIGHTTPD_ENABLED}" == true ]]; then start_service lighttpd enable_service lighttpd else From aa191e92021302dca9bc3e0bcba6612f2880c6ec Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 10:46:07 +1000 Subject: [PATCH 05/12] Update basic-install.sh Signed-off-by: Rob Gill --- automated install/basic-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index fcc66fe1..5e10c9e9 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2290,11 +2290,11 @@ main() { if [[ "${INSTALL_WEB_SERVER}" == true ]]; then enable_service lighttpd fi - # Determin if lighttpd is correctly enabled + # Determine if lighttpd is correctly enabled if check_service_active "lighttpd"; then - LIGHTTPD_ENABLED=true; + LIGHTTPD_ENABLED=true else - LIGHTTPD_ENABLED=false; + LIGHTTPD_ENABLED=false fi # Install and log everything to a file From ce5429aba7e7dcfd3260684bbce85f0fe2dc92f2 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 11:02:06 +1000 Subject: [PATCH 06/12] stickler Signed-off-by: Rob Gill --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9b5fde8e..83764a0f 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1206,7 +1206,7 @@ install_manpage() { # appropriate directory for Pi-hole's man page is not present echo -e "${OVER} ${INFO} man page not installed" return - elif [[ ! -d "/usr/local/share/man/man8"]]; then + elif [[ ! -d "/usr/local/share/man/man8" ]]; then # if not present, create man8 directory mkdir /usr/local/share/man/man8 fi From c0837c726fb5ee32354d3ec2d9ac5b9b776f57f4 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 11:18:13 +1000 Subject: [PATCH 07/12] blank space Signed-off-by: Rob Gill --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 5e10c9e9..91589914 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2296,7 +2296,7 @@ main() { else LIGHTTPD_ENABLED=false fi - + # Install and log everything to a file installPihole | tee -a /proc/$$/fd/3 From ef65bac79b5b6627b51892d2634149d42ce9a97c Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 11:27:35 +1000 Subject: [PATCH 08/12] change status from INFO to CROSS Signed-Off-By: Rob Gill --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 83764a0f..4064ec04 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1220,7 +1220,7 @@ install_manpage() { # Something is wrong with the system's man installation, clean up # our file, (leave everything how we found it). rm /usr/local/share/man/man8/pihole.8 - echo -e "${OVER} ${INFO} man page db not updated, man page not installed" + echo -e "${OVER} ${CROSS} man page db not updated, man page not installed" fi } From d01a568b8bb867beb3304d1af644deaa15e1f269 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 14:13:30 +1000 Subject: [PATCH 09/12] Requested changes (also tabs -> spaces) Signed-off-by: Rob Gill --- pihole.8 | 186 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 96 insertions(+), 90 deletions(-) diff --git a/pihole.8 b/pihole.8 index d62dbf8a..75e3e565 100644 --- a/pihole.8 +++ b/pihole.8 @@ -9,7 +9,7 @@ Pi-hole : A black-hole for internet advertisements .br \fBpihole -a\fR \fB-p\fR password .br -\fBpihole -a\fR (-c|-f|-k) +\fBpihole -a\fR (\fB-c|-f|-k\fR) .br \fBpihole -a\fR [\fB-r\fR hostrecord] .br @@ -33,10 +33,12 @@ pihole -g\fR .br \fBpihole\fR -\fBq\fR [options] .br -\fBpihole\fR \fB-l\fR (on|off|off noflush) +\fBpihole\fR \fB-l\fR (\fBon|off|off noflush\fR) .br \fBpihole -up \fR[--checkonly] .br +\fBpihole -v\fR [-p|-a|-f] [-c|-l|-hash] +.br \fBpihole uninstall .br pihole status @@ -56,269 +58,273 @@ Available commands and options: \fB-w, whitelist\fR [options] [ ] .br - Adds or removes specified domain or domains tho the Whitelist + Adds or removes specified domain or domains tho the Whitelist .br \fB-b, blacklist\fR [options] [ ] .br - Adds or removes specified domain or domains to the blacklist + Adds or removes specified domain or domains to the blacklist .br \fB-wild, wildcard\fR [options] [ ] .br - Add or removes specified domain, and all subdomains to the blacklist -.br - + Add or removes specified domain, and all subdomains to the blacklist .br - (Whitelist/Blacklist manipulation options): + + (Whitelist/Blacklist manipulation options): .br - -d, --delmode Remove domain(s) from the list + -d, --delmode Remove domain(s) from the list .br - -nr, --noreload Update list without refreshing dnsmasq + -nr, --noreload Update list without refreshing dnsmasq .br - -q, --quiet Make output less verbose + -q, --quiet Make output less verbose .br - -l, --list Display all your listed domains + -l, --list Display all your listed domains .br - --nuke Removes all entries in a list + --nuke Removes all entries in a list .br -\fB-d, debug\fR [\fB-a\fR] +\fB-d, debug\fR [-a] .br - Start a debugging session Add '-a' to enable automated debugging + Start a debugging session +.br + + -a Enable automated debugging .br \fB-f, flush\fR .br - Flush the Pi-hole log + Flush the Pi-hole log .br .br \fB-r, reconfigure\fR .br - Reconfigure or Repair Pi-hole subsystems + Reconfigure or Repair Pi-hole subsystems .br \fB-t, tail\fR .br - View the live output of the Pi-hole log + View the live output of the Pi-hole log .br -\fB-a, admin\fR [options] Console +\fB-a, admin\fR [options] .br - -.br - (Admin console options): + + (Admin options): .br - -p, password Set Admin Console password + -p, password Set Web Interface password .br - -c, celsius Set Celsius as preferred temperature unit + -c, celsius Set Celsius as preferred temperature unit .br - -f, fahrenheit Set Fahrenheit as preferred temperature unit + -f, fahrenheit Set Fahrenheit as preferred temperature unit .br - -k, kelvin Set Kelvin as preferred temperature unit + -k, kelvin Set Kelvin as preferred temperature unit .br - -r, hostrecord Add a name to the DNS associated to an IPv4/IPv6 address + -r, hostrecord Add a name to the DNS associated to an IPv4/IPv6 address .br - -e, email Set an administrative contact address for the Block Page + -e, email Set an administrative contact address for the Block Page .br - -i, interface Specify dnsmasq's interface listening behavior + -i, interface Specify dnsmasq's interface listening behavior .br - -l, privacylevel Set privacy level (0 = lowest, 3 = highest) + -l, privacylevel Set privacy level (0 = lowest, 3 = highest) .br .br \fB-c, chronometer\fR [options] .br - Calculates stats and displays to an LCD + Calculates stats and displays to an LCD .br - (Chronometer Options): + (Chronometer Options): .br - -j, --json Output stats as JSON formatted string + -j, --json Output stats as JSON formatted string .br - -r, --refresh Set update frequency (in seconds) + -r, --refresh Set update frequency (in seconds) .br - -e, --exit Output stats and exit witout refreshing + -e, --exit Output stats and exit witout refreshing .br \fB-g, updateGravity\fR .br - Update the list of ad-serving domains + Update the list of ad-serving domains .br \fB-q, query\fR [option] .br - Query the adlists for a specified domain + Query the adlists for a specified domain .br - (Query options): + (Query options): .br - -adlist Print the name of the block list URL + -adlist Print the name of the block list URL .br - -exact Search the block lists for exact domain matches + -exact Search the block lists for exact domain matches .br - -all Return all query matches within a block list + -all Return all query matches within a block list .br \fB-h, --help, help\fR .br - Show a help dialog + Show a help dialog .br \fB-l, logging\fR [on|off|off noflush] .br - Specify whether the Pi-hole log should be used + Specify whether the Pi-hole log should be used .br (Logging options): .br - on Enable the Pi-hole log at /var/log/pihole.log + on Enable the Pi-hole log at /var/log/pihole.log .br - off Disable and flush the Pi-hole log at /var/log/pihole.log + off Disable and flush the Pi-hole log at /var/log/pihole.log .br - off noflush Disable the Pi-hole log at /var/log/pihole.log + off noflush Disable the Pi-hole log at /var/log/pihole.log .br .br \fB-up, updat\fBe\fR\fR\fBPihole\fR [--check-only] .br - Update Pi-hole subsystems + Update Pi-hole subsystems .br - Add '--check-only' to exit script before update is performed. + + --check-only Exit script before update is performed. .br \fB-v, version\fR [repo] [options] .br - Show installed versions of Pi-hole, Admin Console & FTL + Show installed versions of Pi-hole, Web Interface & FTL .br .br - (repo options): + (repo options): .br - -p, --pihole Only retrieve info regarding Pi-hole repository + -p, --pihole Only retrieve info regarding Pi-hole repository .br - -a, --admin Only retrieve info regarding AdminLTE repository + -a, --admin Only retrieve info regarding AdminLTE repository .br - -f, --ftl Only retrieve info regarding FTL repository + -f, --ftl Only retrieve info regarding FTL repository .br - (version options): + (version options): .br - -c, --current Return the current version + -c, --current Return the current version .br - -l, --latest Return the latest version + -l, --latest Return the latest version .br - --hash Return the Github hash from your local repositories + --hash Return the Github hash from your local repositories .br \fBuninstall\fR .br - Uninstall Pi-hole from your system + Uninstall Pi-hole from your system .br \fBstatus\fR .br - Display the running status of Pi-hole subsystems + Display the running status of Pi-hole subsystems .br \fBenable\fR .br - Enable Pi-hole subsystems + Enable Pi-hole subsystems .br \fBdisable\fR [time] .br - Disable Pi-hole subsystems, optionally for a set duration + Disable Pi-hole subsystems, optionally for a set duration .br .br - (time options): + (time options): .br - #s Disable Pi-hole functionality for # second(s) + #s Disable Pi-hole functionality for # second(s) .br - #m Disable Pi-hole functionality for # minute(s) + #m Disable Pi-hole functionality for # minute(s) .br \fBrestartdns\fR .br - Restart Pi-hole subsystems + Restart Pi-hole subsystems .br \fBcheckout\fR [repo][branch] .br - Switch Pi-hole subsystems to a different Github branch + Switch Pi-hole subsystems to a different Github branch .br - (repo options): + (repo options): .br - core Change the branch of Pi-hole's core subsystem + core Change the branch of Pi-hole's core subsystem .br - web Change the branch of Admin Console subsystem + web Change the branch of Admin Console subsystem .br - ftl Change the branch of Pi-hole's FTL subsystem + ftl Change the branch of Pi-hole's FTL subsystem .br - (branch options): + (branch options): .br - master Update subsystems to the latest stable release + master Update subsystems to the latest stable release .br - dev Update subsystems to the latest development release + dev Update subsystems to the latest development release +.br + branchname Update subsystems to the specified branchname .br - .SH "EXAMPLE" + Some usage examples .br - Whitelist/blacklist manipulation + Whitelist/blacklist manipulation .br - \fBpihole -w iloveads.example.com\fR Add "iloveads.example.com" to whitelist + \fBpihole -w iloveads.example.com\fR Add "iloveads.example.com" to whitelist .br - \fBpihole -b -d noads.example.com\fR Remove "noads.example.com" from blacklist + \fBpihole -b -d noads.example.com\fR Remove "noads.example.com" from blacklist .br - \fBpihole -wild ads.example\fR Add "ads.example" as wildcard - would block ads.example.net + \fBpihole -wild example\fR Add "example" as wildcard - would block ads.example.net, example.com etc. .br - Changing the web ui password + Changing the web ui password .br .br - \fBpihole -a -p ExamplePassword\fR Change the password to "ExamplePassword" + \fBpihole -a -p ExamplePassword\fR Change the password to "ExamplePassword" .br - Updating lists from internet sources + Updating lists from internet sources .br .br - \fBpihole -g\fR Update the list of ad-serving domains + \fBpihole -g\fR Update the list of ad-serving domains .br - Displaying version information + Displaying version information .br .br - \fBpihole -v -c\fR Display the current version of AdminLTE + \fBpihole -v -a -c\fR Display the current version of AdminLTE .br .br - Temporarily disabling Pi-hole + Temporarily disabling Pi-hole .br .br - \fBpihole disable 5m\fR Disable Pi-hole functionality for five minutes + \fBpihole disable 5m\fR Disable Pi-hole functionality for five minutes .br .br - Switching Pi-hole subsystem branches + Switching Pi-hole subsystem branches .br .br - \fBpihole checkout master\fR Switch to master branch + \fBpihole checkout master\fR Switch to master branch .br - \fBpihole checkout core dev\fR Switch to core development branch + \fBpihole checkout core dev\fR Switch to core development branch .br .SH "SEE ALSO" -dmasq(8), lighttpd(8) +dnsmasq(8), lighttpd(8) .br .SH "COLOPHON" From 9970f3786fba774db6ebfb087a4c97d28ea91267 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 14:14:55 +1000 Subject: [PATCH 10/12] Requested change Signed-off-by: Rob Gill --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4064ec04..e8b1b9bc 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1198,7 +1198,7 @@ install_manpage() { # Default location for man files for /usr/local/bin is /usr/local/share/man # on lightweight systems may not be present, so check before copying. echo -en " ${INFO} Testing man page installation" - if ! command -v mandb; then + if ! command -v mandb &>/dev/null; then # if mandb is not present, no manpage support echo -e "${OVER} ${INFO} man not installed" return From 213f23aaf6c347e7331b03eb0db16a410efbfac1 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 14:46:45 +1000 Subject: [PATCH 11/12] wildcard & space Signed-off-by: Rob Gill --- pihole.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pihole.8 b/pihole.8 index 75e3e565..76d6b72b 100644 --- a/pihole.8 +++ b/pihole.8 @@ -230,7 +230,7 @@ Available commands and options: Enable Pi-hole subsystems .br -\fBdisable\fR [time] +\fBdisable\fR [time] .br Disable Pi-hole subsystems, optionally for a set duration .br @@ -248,7 +248,7 @@ Available commands and options: Restart Pi-hole subsystems .br -\fBcheckout\fR [repo][branch] +\fBcheckout\fR [repo] [branch] .br Switch Pi-hole subsystems to a different Github branch .br @@ -281,7 +281,7 @@ Some usage examples .br \fBpihole -b -d noads.example.com\fR Remove "noads.example.com" from blacklist .br - \fBpihole -wild example\fR Add "example" as wildcard - would block ads.example.net, example.com etc. + \fBpihole -wild example.com\fR Add "example.com" as wildcard - would block ads.example.com, www.example.com etc. .br Changing the web ui password From 83ff0055b672eab6d237b65ea88fe60acc96dbf6 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Sat, 2 Jun 2018 15:30:51 +1000 Subject: [PATCH 12/12] Test and indicate status This added function tests if pihole-FTL is running when the sysV. Signed-off-by: Rob Gill --- advanced/pihole-FTL.service | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/advanced/pihole-FTL.service b/advanced/pihole-FTL.service index ef8ee9c2..ecc7a52a 100644 --- a/advanced/pihole-FTL.service +++ b/advanced/pihole-FTL.service @@ -69,13 +69,25 @@ stop() { echo } +# Indicate the service status +status() { + if is_running; then + echo "[ ok ] pihole-FTL is running" + exit 0 + else + echo "[ ] pihole-FTL is not running" + exit 1 + fi +} + + ### main logic ### case "$1" in stop) stop ;; status) - status pihole-FTL + status ;; start|restart|reload|condrestart) stop