From 8cb72d87e46e8b9091d82aab105c48a7ec90510e Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 19:50:21 +0100 Subject: [PATCH 01/40] make IPv4/IPv6 checking more robust in gravity --- gravity.sh | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/gravity.sh b/gravity.sh index 3d9c05c4..49a3e2bc 100755 --- a/gravity.sh +++ b/gravity.sh @@ -42,7 +42,7 @@ else fi #Remove the /* from the end of the IPv4addr. -IPv4addr=${IPv4_address%/*} +IPv4_address=${IPv4_address%/*} # Variables for various stages of downloading and formatting the list basename=pihole @@ -246,17 +246,30 @@ gravity_hostFormat() { else echo "::: Error: Unable to determine fully qualified domain name of host" fi - # If there is a value in the $piholeIPv6, then IPv6 will be used, so the awk command modified to create a line for both protocols - if [[ -n "${IPv6_address}" ]];then - # Add hostname and dummy domain to the top of gravity.list to make ping result return a friendlier looking domain! Also allows for an easy way to access the Pi-hole admin console (pi.hole/admin) - echo -e "$IPv4addr $hostname\n$IPv6_address $hostname\n$IPv4addr pi.hole\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc} - cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4addr" -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc} - else - # Otherwise, just create gravity.list as normal using IPv4 - # Add hostname and dummy domain to the top of gravity.list to make ping result return a friendlier looking domain! Also allows for an easy way to access the Pi-hole admin console (pi.hole/admin) - echo -e "$IPv4addr $hostname\n$IPv4addr pi.hole" > ${piholeDir}/${accretionDisc} - cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4addr" '{sub(/\r$/,""); print ipv4addr" "$0}' >> ${piholeDir}/${accretionDisc} - fi + + # Check vars from setupVars.conf to see if we're using IPv4, IPv6, Or both. + if [[ -n "${IPv4_address}" && -n "${IPv6_address}" ]];then + + # Both IPv4 and IPv6 + echo -e "$IPv4_address $hostname\n$IPv6_address $hostname\n$IPv4_address pi.hole\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc} + cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc} + + elif [[ -n "${IPv4_address}" && -z "${IPv6_address}" ]];then + + # Only IPv4 + echo -e "$IPv4addr $hostname\n$IPv4addr pi.hole" > ${piholeDir}/${accretionDisc} + cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" '{sub(/\r$/,""); print ipv4addr" "$0}' >> ${piholeDir}/${accretionDisc} + + elif [[ -z "${IPv4_address}" && -n "${IPv6_address}" ]];then + + # Only IPv6 + echo -e "$IPv6_address $hostname\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc} + cat ${piholeDir}/${eventHorizon} | awk -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc} + + elif [[ -z "${IPv4_address}" && -z "${IPv6_address}" ]];then + echo "::: No IP Values found! Please run 'pihole -r' and choose reconfigure to restore values" + exit 1 + fi # Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it cp ${piholeDir}/${accretionDisc} ${adList} From 60d17b97f521595562cc1dba6cd13104e4f9eea1 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 19:51:32 +0100 Subject: [PATCH 02/40] spacing --- gravity.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gravity.sh b/gravity.sh index 49a3e2bc..4cfe7bfc 100755 --- a/gravity.sh +++ b/gravity.sh @@ -248,27 +248,27 @@ gravity_hostFormat() { fi # Check vars from setupVars.conf to see if we're using IPv4, IPv6, Or both. - if [[ -n "${IPv4_address}" && -n "${IPv6_address}" ]];then + if [[ -n "${IPv4_address}" && -n "${IPv6_address}" ]];then # Both IPv4 and IPv6 - echo -e "$IPv4_address $hostname\n$IPv6_address $hostname\n$IPv4_address pi.hole\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc} - cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc} + echo -e "$IPv4_address $hostname\n$IPv6_address $hostname\n$IPv4_address pi.hole\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc} + cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc} elif [[ -n "${IPv4_address}" && -z "${IPv6_address}" ]];then # Only IPv4 echo -e "$IPv4addr $hostname\n$IPv4addr pi.hole" > ${piholeDir}/${accretionDisc} - cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" '{sub(/\r$/,""); print ipv4addr" "$0}' >> ${piholeDir}/${accretionDisc} + cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" '{sub(/\r$/,""); print ipv4addr" "$0}' >> ${piholeDir}/${accretionDisc} elif [[ -z "${IPv4_address}" && -n "${IPv6_address}" ]];then # Only IPv6 echo -e "$IPv6_address $hostname\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc} - cat ${piholeDir}/${eventHorizon} | awk -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc} + cat ${piholeDir}/${eventHorizon} | awk -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc} elif [[ -z "${IPv4_address}" && -z "${IPv6_address}" ]];then echo "::: No IP Values found! Please run 'pihole -r' and choose reconfigure to restore values" - exit 1 + exit 1 fi # Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it From 25343da6b7baa44ce7c82cb5725af7fdd6ed113f Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 20:03:29 +0100 Subject: [PATCH 03/40] wrong variable name --- gravity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 4cfe7bfc..0b0e78b5 100755 --- a/gravity.sh +++ b/gravity.sh @@ -257,7 +257,7 @@ gravity_hostFormat() { elif [[ -n "${IPv4_address}" && -z "${IPv6_address}" ]];then # Only IPv4 - echo -e "$IPv4addr $hostname\n$IPv4addr pi.hole" > ${piholeDir}/${accretionDisc} + echo -e "$IPv4_address $hostname\n$IPv4_address pi.hole" > ${piholeDir}/${accretionDisc} cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" '{sub(/\r$/,""); print ipv4addr" "$0}' >> ${piholeDir}/${accretionDisc} elif [[ -z "${IPv4_address}" && -n "${IPv6_address}" ]];then From 59ba6f8aec071d10956f5e11d28c91a1fdacba66 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 22:06:19 +0100 Subject: [PATCH 04/40] add flag to skip download of lists --- gravity.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gravity.sh b/gravity.sh index 0b0e78b5..d214b57e 100755 --- a/gravity.sh +++ b/gravity.sh @@ -54,6 +54,8 @@ supernova=${basename}.1.supernova.txt eventHorizon=${basename}.2.eventHorizon.txt accretionDisc=${basename}.3.accretionDisc.txt +skipDownload=false + # Warn users still using pihole.conf that it no longer has any effect (I imagine about 2 people use it) if [[ -r ${piholeDir}/pihole.conf ]];then echo "::: pihole.conf file no longer supported. Over-rides in this file are ignored." @@ -162,7 +164,7 @@ gravity_spinup() { agent="Mozilla/10.0" - echo -n "::: Getting $domain list..." + # Use a case statement to download lists that need special cURL commands # to complete properly and reset the user agent when required @@ -179,7 +181,12 @@ gravity_spinup() { # Default is a simple request *) cmd_ext="" esac - gravity_transport "$url" "$cmd_ext" "$agent" + if [[ "${skipDownload}" == false ]]; then + echo -n "::: Getting $domain list..." + gravity_transport "$url" "$cmd_ext" "$agent" + else + echo "::: Using cached $domain list" + fi done } @@ -317,7 +324,7 @@ gravity_reload() { # Reload hosts file echo ":::" echo -n "::: Refresh lists in dnsmasq..." - + #ensure /etc/dnsmasq.d/01-pihole.conf is pointing at the correct list! #First escape forward slashes in the path: adList=${adList//\//\\\/} @@ -345,15 +352,18 @@ gravity_reload() { } + + for var in "$@" do case "$var" in "-f" | "--force" ) forceGrav=true;; "-h" | "--help" ) helpFunc;; + "-sd" | "--skip-download" ) skipDownload=true;; esac done -if [[ ${forceGrav} == true ]]; then +if [[ "${forceGrav}" == true ]]; then echo -n "::: Deleting exising list cache..." rm /etc/pihole/list.* echo " done!" From b88fe572fe53b8354686facce9a58d0c9f093df8 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 23:15:05 +0100 Subject: [PATCH 05/40] Whitelist/Blacklist domains directly in the Event Horizon. --- gravity.sh | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/gravity.sh b/gravity.sh index d214b57e..6c143cfb 100755 --- a/gravity.sh +++ b/gravity.sh @@ -30,6 +30,8 @@ adListFile=/etc/pihole/adlists.list adListDefault=/etc/pihole/adlists.default whitelistScript=/opt/pihole/whitelist.sh blacklistScript=/opt/pihole/blacklist.sh +whitelistFile=/etc/pihole/whitelist.txt +blacklistFile=/etc/pihole/blacklist.txt #Source the setupVars from install script for the IP setupVars=/etc/pihole/setupVars.conf @@ -205,19 +207,20 @@ gravity_Schwarzchild() { gravity_Blacklist(){ # Append blacklist entries if they exist - echo -n "::: Running blacklist script to update HOSTS file...." - ${blacklistScript} -f -nr -q > /dev/null - - numBlacklisted=$(wc -l < "/etc/pihole/blacklist.txt") + numBlacklisted=$(wc -l < "${blacklistFile}") plural=; [[ "$numBlacklisted" != "1" ]] && plural=s - echo " $numBlacklisted domain${plural} blacklisted!" + + echo -n "::: BlackListing $numBlacklisted domain${plural}..." + cat ${blacklistFile} >> ${piholeDir}/${eventHorizon} + echo " done!" } gravity_Whitelist() { + #${piholeDir}/${eventHorizon}) echo ":::" # Prevent our sources from being pulled into the hole plural=; [[ "${sources[@]}" != "1" ]] && plural=s - echo -n "::: Adding ${#sources[@]} adlist source${plural} to the whitelist..." + echo -n "::: Adding adlist source${plural} to the whitelist..." urls=() for url in "${sources[@]}" @@ -227,11 +230,16 @@ gravity_Whitelist() { done echo " done!" - echo -n "::: Running whitelist script to update HOSTS file...." - ${whitelistScript} -f -nr -q "${urls[@]}" > /dev/null - numWhitelisted=$(wc -l < "/etc/pihole/whitelist.txt") + # Ensure adlist domains are in whitelist.txt + ${whitelistScript} -nr -q "${urls[@]}" > /dev/null + + # Remove anything in whitelist.txt from the Event Horizon + numWhitelisted=$(wc -l < "${whitelistFile}") plural=; [[ "$numWhitelisted" != "1" ]] && plural=s - echo " $numWhitelisted domain${plural} whitelisted!" + echo -n "::: Whitelisting $numWhitelisted domain${plural}..." + grep -F -x -v -f ${whitelistFile} ${piholeDir}/${eventHorizon} > ${piholeDir}/${eventHorizon}.tmp + mv ${piholeDir}/${eventHorizon}.tmp ${piholeDir}/${eventHorizon} + echo " done!" } gravity_unique() { @@ -351,9 +359,6 @@ gravity_reload() { fi } - - - for var in "$@" do case "$var" in @@ -375,8 +380,11 @@ gravity_collapse gravity_spinup gravity_Schwarzchild gravity_advanced -gravity_hostFormat -gravity_blackbody + gravity_Whitelist gravity_Blacklist + +gravity_hostFormat +gravity_blackbody + gravity_reload From a41eff1276f31a2c7f0840a4c3d042be0d7ad382 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 23:16:52 +0100 Subject: [PATCH 06/40] Blacklist script now only directly edits blacklist.txt. DOES NOT TOUCH HOST FILE, instead calls gravity with a no download argument --- advanced/Scripts/blacklist.sh | 99 ++--------------------------------- 1 file changed, 3 insertions(+), 96 deletions(-) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index 8bcf22bf..87e117bf 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -19,7 +19,6 @@ helpFunc() echo "::: Options:" echo "::: -d, --delmode Remove domains from the blacklist" echo "::: -nr, --noreload Update blacklist without refreshing dnsmasq" - echo "::: -f, --force Force updating of the hosts files, even if there are no changes" echo "::: -q, --quiet output is less verbose" echo "::: -h, --help Show this help dialog" echo "::: -l, --list Display your blacklisted domains" @@ -37,40 +36,11 @@ adList=${piholeDir}/gravity.list blacklist=${piholeDir}/blacklist.txt reload=true addmode=true -force=false verbose=true domList=() domToRemoveList=() -piholeIPfile=/etc/pihole/piholeIP -piholeIPv6file=/etc/pihole/.useIPv6 - -if [[ -f ${piholeIPfile} ]];then - # If the file exists, it means it was exported from the installation script and we should use that value instead of detecting it in this script - piholeIP=$(cat ${piholeIPfile}) - #rm $piholeIPfile -else - # Otherwise, the IP address can be taken directly from the machine, which will happen when the script is run by the user and not the installation script - IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}') - piholeIPCIDR=$(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}') - piholeIP=${piholeIPCIDR%/*} -fi - -modifyHost=false - -# After setting defaults, check if there's local overrides -if [[ -r ${piholeDir}/pihole.conf ]];then - echo "::: Local calibration requested..." - . ${piholeDir}/pihole.conf -fi - - -if [[ -f ${piholeIPv6file} ]];then - # If the file exists, then the user previously chose to use IPv6 in the automated installer - piholeIPv6=$(ip -6 route get 2001:4860:4860::8888 | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }') -fi - HandleOther(){ #check validity of domain validDomain=$(echo "$1" | perl -ne'print if /\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/') @@ -105,7 +75,6 @@ AddDomain(){ echo -n "::: Adding $1 to blacklist file..." fi echo "$1" >> ${blacklist} - modifyHost=true echo " done!" else if ${verbose}; then @@ -124,68 +93,16 @@ RemoveDomain(){ echo "::: $1 is NOT blacklisted! No need to remove" fi else - #Domain is in the blacklist file, add to a temporary array + #Domain is in the blacklist file,remove it if ${verbose}; then echo "::: Un-blacklisting $dom..." fi - domToRemoveList=("${domToRemoveList[@]}" $1) - modifyHost=true + echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist} fi } -ModifyHostFile(){ - if ${addmode}; then - #add domains to the hosts file - if [[ -r ${blacklist} ]];then - numberOf=$(cat ${blacklist} | sed '/^\s*$/d' | wc -l) - plural=; [[ "$numberOf" != "1" ]] && plural=s - echo ":::" - echo -n "::: Modifying HOSTS file to blacklist $numberOf domain${plural}..." - if [[ -n ${piholeIPv6} ]];then - cat ${blacklist} | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${adList} - else - cat ${blacklist} | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >>${adList} - fi - fi - else - echo ":::" - for dom in "${domToRemoveList[@]}" - do - #we need to remove the domains from the blacklist file and the host file - echo "::: $dom" - echo -n "::: removing from HOSTS file..." - echo "$dom" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /[^.]'{}'(?!.)/;' ${adList} - echo " done!" - echo -n "::: removing from blackist.txt..." - echo "$dom" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist} - echo " done!" - done - fi -} - Reload() { - # Reload hosts file - echo ":::" - echo -n "::: Refresh lists in dnsmasq..." - - dnsmasqPid=$(pidof dnsmasq) - - if [[ ${dnsmasqPid} ]]; then - # service already running - reload config - if [ -x "$(command -v systemctl)" ]; then - systemctl restart dnsmasq - else - service dnsmasq restart - fi - else - # service not running, start it up - if [ -x "$(command -v systemctl)" ]; then - systemctl start dnsmasq - else - service dnsmasq start - fi - fi - echo " done!" + pihole -g -sd } DisplayBlist() { @@ -206,7 +123,6 @@ do case "$var" in "-nr"| "--noreload" ) reload=false;; "-d" | "--delmode" ) addmode=false;; - "-f" | "--force" ) force=true;; "-q" | "--quiet" ) verbose=false;; "-h" | "--help" ) helpFunc;; "-l" | "--list" ) DisplayBlist;; @@ -216,15 +132,6 @@ done PopBlacklistFile -if ${modifyHost} || ${force}; then - ModifyHostFile -else - if ${verbose}; then - echo "::: No changes need to be made" - fi - exit 1 -fi - if ${reload}; then Reload fi From a64f4cd8712d3be1fabc4d943b3c68811797b80e Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 23:17:20 +0100 Subject: [PATCH 07/40] whitelist script now only directly edits whitelist.txt. DOES NOT TOUCH HOST FILE, instead calls gravity with a no download argument --- advanced/Scripts/whitelist.sh | 119 ++-------------------------------- 1 file changed, 6 insertions(+), 113 deletions(-) diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index f715a2fd..2b572d00 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -20,7 +20,6 @@ helpFunc() echo "::: Options:" echo "::: -d, --delmode Remove domains from the whitelist" echo "::: -nr, --noreload Update Whitelist without refreshing dnsmasq" - echo "::: -f, --force Force updating of the hosts files, even if there are no changes" echo "::: -q, --quiet output is less verbose" echo "::: -h, --help Show this help dialog" echo "::: -l, --list Display your whitelisted domains" @@ -38,39 +37,11 @@ adList=${piholeDir}/gravity.list whitelist=${piholeDir}/whitelist.txt reload=true addmode=true -force=false verbose=true domList=() domToRemoveList=() -piholeIPfile=/etc/pihole/piholeIP -piholeIPv6file=/etc/pihole/.useIPv6 - -if [[ -f ${piholeIPfile} ]];then - # If the file exists, it means it was exported from the installation script and we should use that value instead of detecting it in this script - piholeIP=$(cat ${piholeIPfile}) - #rm $piholeIPfile -else - # Otherwise, the IP address can be taken directly from the machine, which will happen when the script is run by the user and not the installation script - IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}') - piholeIPCIDR=$(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}') - piholeIP=${piholeIPCIDR%/*} -fi - -modifyHost=false - -# After setting defaults, check if there's local overrides -if [[ -r ${piholeDir}/pihole.conf ]];then - echo "::: Local calibration requested..." - . ${piholeDir}/pihole.conf -fi - -if [[ -f ${piholeIPv6file} ]];then - # If the file exists, then the user previously chose to use IPv6 in the automated installer - piholeIPv6=$(ip -6 route get 2001:4860:4860::8888 | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }') -fi - HandleOther(){ #check validity of domain validDomain=$(echo "$1" | perl -ne'print if /\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/') @@ -107,8 +78,7 @@ AddDomain(){ echo -n "::: Adding $1 to $whitelist..." fi echo "$1" >> ${whitelist} - modifyHost=true - if ${verbose}; then + if ${verbose}; then echo " done!" fi else @@ -128,81 +98,13 @@ RemoveDomain(){ echo "::: $1 is NOT whitelisted! No need to remove" fi else - #Domain is in the whitelist file, add to a temporary array and remove from whitelist file - #if $verbose; then - #echo "::: Un-whitelisting $dom..." - #fi - domToRemoveList=("${domToRemoveList[@]}" $1) - modifyHost=true + echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} fi } -ModifyHostFile(){ - if ${addmode}; then - #remove domains in from hosts file - if [[ -r ${whitelist} ]];then - # Remove whitelist entries - numberOf=$(cat ${whitelist} | sed '/^\s*$/d' | wc -l) - plural=; [[ "$numberOf" != "1" ]] && plural=s - echo ":::" - echo -n "::: Modifying HOSTS file to whitelist $numberOf domain${plural}..." - awk -F':' '{print $1}' ${whitelist} | while read -r line; do echo "$piholeIP $line"; done > /etc/pihole/whitelist.tmp - awk -F':' '{print $1}' ${whitelist} | while read -r line; do echo "$piholeIPv6 $line"; done >> /etc/pihole/whitelist.tmp - echo "l" >> /etc/pihole/whitelist.tmp - grep -F -x -v -f ${piholeDir}/whitelist.tmp ${adList} > ${piholeDir}/gravity.tmp - rm ${adList} - mv ${piholeDir}/gravity.tmp ${adList} - rm ${piholeDir}/whitelist.tmp - echo " done!" - - fi - else - #we need to add the removed domains to the hosts file - echo ":::" - echo "::: Modifying HOSTS file to un-whitelist domains..." - for rdom in "${domToRemoveList[@]}" - do - if grep -q "$rdom" /etc/pihole/*.domains; then - echo "::: AdLists contain $rdom, re-adding block" - if [[ -n ${piholeIPv6} ]];then - echo -n "::: Restoring block for $rdom on IPv4 and IPv6..." - echo "$rdom" | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${adList} - echo " done!" - else - echo -n "::: Restoring block for $rdom on IPv4..." - echo "$rdom" | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >>${adList} - echo " done!" - fi - fi - echo -n "::: Removing $rdom from $whitelist..." - echo "$rdom" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} - echo " done!" - done - fi -} - Reload() { # Reload hosts file - echo ":::" - echo -n "::: Refresh lists in dnsmasq..." - dnsmasqPid=$(pidof dnsmasq) - - if [[ ${dnsmasqPid} ]]; then - # service already running - reload config - if [ -x "$(command -v systemctl)" ]; then - systemctl restart dnsmasq - else - service dnsmasq restart - fi - else - # service not running, start it up - if [ -x "$(command -v systemctl)" ]; then - systemctl start dnsmasq - else - service dnsmasq start - fi - fi - echo " done!" + pihole -g -sd } DisplayWlist() { @@ -223,7 +125,6 @@ do case "$var" in "-nr"| "--noreload" ) reload=false;; "-d" | "--delmode" ) addmode=false;; - "-f" | "--force" ) force=true;; "-q" | "--quiet" ) verbose=false;; "-h" | "--help" ) helpFunc;; "-l" | "--list" ) DisplayWlist;; @@ -233,16 +134,8 @@ done PopWhitelistFile -if ${modifyHost} || ${force}; then - ModifyHostFile -else - if ${verbose}; then - echo ":::" - echo "::: No changes need to be made" - fi - exit 1 -fi - if ${reload}; then Reload -fi \ No newline at end of file +fi + + From 3f73c61cee236ed1a53cbe76d59b983b10e9769a Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 23:52:54 +0100 Subject: [PATCH 08/40] cache event horizon before white/blacklists are applied for quicker processing on white/blacklist calls of gravity --- gravity.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/gravity.sh b/gravity.sh index 6c143cfb..b525e936 100755 --- a/gravity.sh +++ b/gravity.sh @@ -53,7 +53,8 @@ adList=${piholeDir}/gravity.list justDomainsExtension=domains matterAndLight=${basename}.0.matterandlight.txt supernova=${basename}.1.supernova.txt -eventHorizon=${basename}.2.eventHorizon.txt +preEventHorizon=list.preEventHorizon +eventHorizon=${basename}.2.supernova.txt accretionDisc=${basename}.3.accretionDisc.txt skipDownload=false @@ -186,8 +187,6 @@ gravity_spinup() { if [[ "${skipDownload}" == false ]]; then echo -n "::: Getting $domain list..." gravity_transport "$url" "$cmd_ext" "$agent" - else - echo "::: Using cached $domain list" fi done } @@ -237,17 +236,16 @@ gravity_Whitelist() { numWhitelisted=$(wc -l < "${whitelistFile}") plural=; [[ "$numWhitelisted" != "1" ]] && plural=s echo -n "::: Whitelisting $numWhitelisted domain${plural}..." - grep -F -x -v -f ${whitelistFile} ${piholeDir}/${eventHorizon} > ${piholeDir}/${eventHorizon}.tmp - mv ${piholeDir}/${eventHorizon}.tmp ${piholeDir}/${eventHorizon} + grep -F -x -v -f ${whitelistFile} ${piholeDir}/${preEventHorizon} > ${piholeDir}/${eventHorizon} echo " done!" } gravity_unique() { # Sort and remove duplicates echo -n "::: Removing duplicate domains...." - sort -u ${piholeDir}/${supernova} > ${piholeDir}/${eventHorizon} + sort -u ${piholeDir}/${supernova} > ${piholeDir}/${preEventHorizon} echo " done!" - numberOf=$(wc -l < ${piholeDir}/${eventHorizon}) + numberOf=$(wc -l < ${piholeDir}/${preEventHorizon}) echo "::: $numberOf unique domains trapped in the event horizon." } @@ -378,9 +376,14 @@ fi cp /etc/.pihole/adlists.default /etc/pihole/adlists.default gravity_collapse gravity_spinup -gravity_Schwarzchild -gravity_advanced - +if [[ "${skipDownload}" == false ]]; then + gravity_Schwarzchild + gravity_advanced +else + echo "::: Using cached Event Horizon list..." + numberOf=$(wc -l < ${piholeDir}/${preEventHorizon}) + echo "::: $numberOf unique domains trapped in the event horizon." +fi gravity_Whitelist gravity_Blacklist From a7fa7466fb59d3af2f643abc76c50c752652ffea Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 23:54:43 +0100 Subject: [PATCH 09/40] remove no longer needed code --- gravity.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/gravity.sh b/gravity.sh index b525e936..a5e7c047 100755 --- a/gravity.sh +++ b/gravity.sh @@ -97,20 +97,6 @@ gravity_collapse() { done < ${adListDefault} echo " done!" fi - - # Create the pihole resource directory if it doesn't exist. Future files will be stored here - if [[ -d ${piholeDir} ]];then - # Temporary hack to allow non-root access to pihole directory - # Will update later, needed for existing installs, new installs should - # create this directory as non-root - chmod 777 ${piholeDir} - echo ":::" - echo "::: Existing pihole directory found" - else - echo "::: Creating pihole directory..." - mkdir ${piholeDir} - chmod 777 ${piholeDir} - fi } # patternCheck - check to see if curl downloaded any new files. From 9aa38cf0ae11b0142ba7ac74341701f953af3c8f Mon Sep 17 00:00:00 2001 From: Promofaux Date: Wed, 19 Oct 2016 23:57:43 +0100 Subject: [PATCH 10/40] mv patternbuffer instead of cp, then no need to clean up --- gravity.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gravity.sh b/gravity.sh index a5e7c047..990b18ee 100755 --- a/gravity.sh +++ b/gravity.sh @@ -107,7 +107,7 @@ gravity_patternCheck() { # Some of the blocklists are copyright, they need to be downloaded # and stored as is. They can be processed for content after they # have been saved. - cp "$patternBuffer" "$saveLocation" + mv "$patternBuffer" "$saveLocation" echo " List updated, transport successful!" else # curl didn't download any host files, probably because of the date check @@ -133,8 +133,6 @@ gravity_transport() { curl -s -L ${cmd_ext} ${heisenbergCompensator} -A "$agent" ${url} > ${patternBuffer} # Check for list updates gravity_patternCheck "$patternBuffer" - # Cleanup - rm -f "$patternBuffer" } # spinup - main gravity function From 16f1d7fad9420b8fb6aa83cbcd9c82400f122444 Mon Sep 17 00:00:00 2001 From: tuplink Date: Wed, 19 Oct 2016 21:50:34 -0400 Subject: [PATCH 11/40] Blacklist unwhitelisted --- advanced/Scripts/whitelist.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 2b572d00..b294e7b6 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -99,6 +99,8 @@ RemoveDomain(){ fi else echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} + #Blacklist unwhitelisted + ${blacklistScript} $1 fi } From 74bfcea6a8653299f261efe89228654b1b1b1f16 Mon Sep 17 00:00:00 2001 From: tuplink Date: Wed, 19 Oct 2016 22:00:03 -0400 Subject: [PATCH 12/40] add blacklistScript var --- advanced/Scripts/whitelist.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index b294e7b6..2dea6e7c 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -33,6 +33,7 @@ fi #globals basename=pihole piholeDir=/etc/${basename} +blacklistScript=/opt/pihole/blacklist.sh adList=${piholeDir}/gravity.list whitelist=${piholeDir}/whitelist.txt reload=true From 41056ace0264deb0102425e9e5983bae4f7a664d Mon Sep 17 00:00:00 2001 From: tuplink Date: Thu, 20 Oct 2016 06:29:53 -0400 Subject: [PATCH 13/40] use pihole instead of direct path --- advanced/Scripts/whitelist.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 2dea6e7c..3d0561ef 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -33,7 +33,6 @@ fi #globals basename=pihole piholeDir=/etc/${basename} -blacklistScript=/opt/pihole/blacklist.sh adList=${piholeDir}/gravity.list whitelist=${piholeDir}/whitelist.txt reload=true @@ -100,8 +99,7 @@ RemoveDomain(){ fi else echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} - #Blacklist unwhitelisted - ${blacklistScript} $1 + pihole -g fi } From bbcf4800de3cf9253502285c3fe40547da13902b Mon Sep 17 00:00:00 2001 From: tuplink Date: Thu, 20 Oct 2016 06:30:48 -0400 Subject: [PATCH 14/40] use pihole instead of direct path --- advanced/Scripts/whitelist.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 3d0561ef..a2e31c8a 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -99,6 +99,7 @@ RemoveDomain(){ fi else echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} + #reload gravity to pickup any entries this may have removed pihole -g fi } From 36231830728c530566a3ae7c227d42884601bee8 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Thu, 20 Oct 2016 13:29:12 +0100 Subject: [PATCH 15/40] Remove reference to non-existent script --- advanced/pihole.cron | 4 ---- 1 file changed, 4 deletions(-) diff --git a/advanced/pihole.cron b/advanced/pihole.cron index 2d06fbbc..c86dded3 100644 --- a/advanced/pihole.cron +++ b/advanced/pihole.cron @@ -16,10 +16,6 @@ # Pi-hole: Update Pi-hole! Uncomment to enable auto update #30 2 * * 7 root /usr/local/bin/pihole updatePihole -# Pi-hole: Parse the log file before it is flushed and save the stats to a database -# This will be used for a historical view of your Pi-hole's performance -#50 23 * * * root /usr/local/bin/dailyLog.sh # note: this is outdated - # Pi-hole: Flush the log daily at 00:00 so it doesn't get out of control # Stats will be viewable in the Web interface thanks to the cron job above 00 00 * * * root /usr/local/bin/pihole flush From c71a976e7634e5c2cf7e5103c506c8c0513406a8 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Thu, 20 Oct 2016 13:37:07 +0100 Subject: [PATCH 16/40] kill off an old ugly hack --- gravity.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 990b18ee..a7439bf5 100755 --- a/gravity.sh +++ b/gravity.sh @@ -320,7 +320,6 @@ gravity_reload() { adList=${adList//\//\\\/} #Now replace the line in dnsmasq file sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf - find "$piholeDir" -type f -exec chmod 666 {} \; dnsmasqPid=$(pidof dnsmasq) From 7d7e17b351d8469bb65b8c47284b33c51f286cbb Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 08:45:20 -0400 Subject: [PATCH 17/40] add toggle to enable or disable pi-hole --- gravity.sh | 2 +- pihole | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 990b18ee..3cc621c3 100755 --- a/gravity.sh +++ b/gravity.sh @@ -319,7 +319,7 @@ gravity_reload() { #First escape forward slashes in the path: adList=${adList//\//\\\/} #Now replace the line in dnsmasq file - sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf +# sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf find "$piholeDir" -type f -exec chmod 666 {} \; dnsmasqPid=$(pidof dnsmasq) diff --git a/pihole b/pihole index 6be32acf..8828dfe4 100755 --- a/pihole +++ b/pihole @@ -96,6 +96,50 @@ versionFunc() { exit 0 } +restartDNS() { + dnsmasqPid=$(pidof dnsmasq) + if [[ ${dnsmasqPid} ]]; then + # service already running - reload config + if [ -x "$(command -v systemctl)" ]; then + systemctl restart dnsmasq + else + service dnsmasq restart + fi + else + # service not running, start it up + if [ -x "$(command -v systemctl)" ]; then + systemctl start dnsmasq + else + service dnsmasq start + fi + fi +} + +piholeEnable() { + if [[ "${1}" == "0" ]] ; then + #Disable Pihole + sed -i 's/^addn-hosts/#addn-hosts/' /etc/dnsmasq.d/01-pihole.conf + else + #Enable pihole + sed -i 's/^#addn-hosts/addn-hosts/' /etc/dnsmasq.d/01-pihole.conf + fi + restartDNS +} + +piholeStatus() { + if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=") ]] ; then + echo "pihole is Diabled" + else + if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then + echo "pihole is Enabled" + else + echo "no hosts file linked to dnsmasq, adding it in enabled state" + echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf + fi + fi +} + + helpFunc() { echo "::: Control all PiHole specific functions!" echo ":::" @@ -115,6 +159,10 @@ helpFunc() { echo "::: -v, version Show current versions" echo "::: -q, query Query the adlists for a specific domain" echo "::: uninstall Uninstall Pi-Hole from your system :(!" + echo "::: status Is Pi-Hole Enabled or Disabled" + echo "::: enable Enable Pi-Hole DNS Blocking" + echo "::: disable Disable Pi-Hole DNS Blocking" + echo "::: restartdnsmasq Restart dnsmasq" exit 0 } @@ -137,5 +185,10 @@ case "$1" in "-v" | "version" ) versionFunc "$@";; "-q" | "query" ) queryFunc "$@";; "uninstall" ) uninstallFunc;; +"enable" ) piholeEnable 1;; +"disable" ) piholeEnable 0;; +"status" ) piholeStatus;; +"restartdnsmasq" ) restartDNS;; + * ) helpFunc;; esac From aaee895b2bd282ace43ae7f8b504bc81303f1e59 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 08:58:36 -0400 Subject: [PATCH 18/40] add pihole status web option to return 1 or 0 for easy use with php --- pihole | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pihole b/pihole index 8828dfe4..1651ac9c 100755 --- a/pihole +++ b/pihole @@ -128,13 +128,16 @@ piholeEnable() { piholeStatus() { if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=") ]] ; then - echo "pihole is Diabled" + if [[ "${1}" == "web" ]] ; then echo 0; else echo "::: pihole is Diabled"; fi else if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then - echo "pihole is Enabled" + if [[ "${1}" == "web" ]] ; then echo 1; else echo "::: pihole is Enabled"; fi else - echo "no hosts file linked to dnsmasq, adding it in enabled state" - echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf + if [[ "${1}" == "web" ]] ; then echo 1; else + echo "::: no hosts file linked to dnsmasq, adding it in enabled state" + echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf + restartDNS + fi fi fi } @@ -187,7 +190,7 @@ case "$1" in "uninstall" ) uninstallFunc;; "enable" ) piholeEnable 1;; "disable" ) piholeEnable 0;; -"status" ) piholeStatus;; +"status" ) piholeStatus "$2";; "restartdnsmasq" ) restartDNS;; * ) helpFunc;; From a9d17c96bee91828148f54f82a6e6a27b5bc2528 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 09:03:20 -0400 Subject: [PATCH 19/40] include status at end of gravity so if it is disabled you will see it when running --- gravity.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/gravity.sh b/gravity.sh index 3cc621c3..d43de697 100755 --- a/gravity.sh +++ b/gravity.sh @@ -375,3 +375,4 @@ gravity_hostFormat gravity_blackbody gravity_reload +pihole status From 60873144ea7d071def63b68a5e860c0d6aaa3de0 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 09:09:35 -0400 Subject: [PATCH 20/40] make last line of script return a new line been bugging me for awhile --- gravity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index d43de697..2d3c4f09 100755 --- a/gravity.sh +++ b/gravity.sh @@ -313,7 +313,7 @@ gravity_reload() { # Reload hosts file echo ":::" - echo -n "::: Refresh lists in dnsmasq..." + echo "::: Refresh lists in dnsmasq..." #ensure /etc/dnsmasq.d/01-pihole.conf is pointing at the correct list! #First escape forward slashes in the path: From dda448e0503eaeb8d95992fbdb3b29dd216c8e4a Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 09:15:03 -0400 Subject: [PATCH 21/40] use finction in pihole to restart dnsmasq --- gravity.sh | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/gravity.sh b/gravity.sh index 2d3c4f09..d51cc814 100755 --- a/gravity.sh +++ b/gravity.sh @@ -322,23 +322,7 @@ gravity_reload() { # sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf find "$piholeDir" -type f -exec chmod 666 {} \; - dnsmasqPid=$(pidof dnsmasq) - - if [[ ${dnsmasqPid} ]]; then - # service already running - reload config - if [ -x "$(command -v systemctl)" ]; then - systemctl restart dnsmasq - else - service dnsmasq restart - fi - else - # service not running, start it up - if [ -x "$(command -v systemctl)" ]; then - systemctl start dnsmasq - else - service dnsmasq start - fi - fi + pihole restartdnsmasq } for var in "$@" From 3ca3eaa62cd229dd4ead714af6ad2b4f2f111419 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 09:40:45 -0400 Subject: [PATCH 22/40] change restartdnsmasq to restartdns --- gravity.sh | 2 +- pihole | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gravity.sh b/gravity.sh index d51cc814..cdcf486c 100755 --- a/gravity.sh +++ b/gravity.sh @@ -322,7 +322,7 @@ gravity_reload() { # sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf find "$piholeDir" -type f -exec chmod 666 {} \; - pihole restartdnsmasq + pihole restartdns } for var in "$@" diff --git a/pihole b/pihole index 1651ac9c..bd49f63d 100755 --- a/pihole +++ b/pihole @@ -165,7 +165,7 @@ helpFunc() { echo "::: status Is Pi-Hole Enabled or Disabled" echo "::: enable Enable Pi-Hole DNS Blocking" echo "::: disable Disable Pi-Hole DNS Blocking" - echo "::: restartdnsmasq Restart dnsmasq" + echo "::: restartdns Restart dnsmasq" exit 0 } @@ -191,7 +191,7 @@ case "$1" in "enable" ) piholeEnable 1;; "disable" ) piholeEnable 0;; "status" ) piholeStatus "$2";; -"restartdnsmasq" ) restartDNS;; +"restartdns" ) restartDNS;; * ) helpFunc;; esac From 15d68467a1c082b422d2a8be3d3c23e94afbe5a5 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 10:12:02 -0400 Subject: [PATCH 23/40] attempt to fix --- gravity.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gravity.sh b/gravity.sh index d4298a31..f4f075ad 100755 --- a/gravity.sh +++ b/gravity.sh @@ -319,13 +319,8 @@ gravity_reload() { #First escape forward slashes in the path: adList=${adList//\//\\\/} #Now replace the line in dnsmasq file -<<<<<<< HEAD # sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf -======= - sed -i "s/^addn-hosts.*/addn-hosts=$adList/" /etc/dnsmasq.d/01-pihole.conf ->>>>>>> upstream/promoTweaksTheSecond - pihole restartdns } From e1c56bcbfec8cd9fd00577e51a9196966ff07ef7 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 10:19:03 -0400 Subject: [PATCH 24/40] remove a commit in whitelist --- advanced/Scripts/whitelist.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index a2e31c8a..2b572d00 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -99,8 +99,6 @@ RemoveDomain(){ fi else echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} - #reload gravity to pickup any entries this may have removed - pihole -g fi } From 9056a5a7b694115fcbdaaa0ba04b3b9f32147cc3 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 11:05:49 -0400 Subject: [PATCH 25/40] fix spelling / replace tabs with spaces in help --- pihole | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pihole b/pihole index bd49f63d..afabe9bb 100755 --- a/pihole +++ b/pihole @@ -128,7 +128,7 @@ piholeEnable() { piholeStatus() { if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=") ]] ; then - if [[ "${1}" == "web" ]] ; then echo 0; else echo "::: pihole is Diabled"; fi + if [[ "${1}" == "web" ]] ; then echo 0; else echo "::: pihole is Disabled"; fi else if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then if [[ "${1}" == "web" ]] ; then echo 1; else echo "::: pihole is Enabled"; fi @@ -162,10 +162,10 @@ helpFunc() { echo "::: -v, version Show current versions" echo "::: -q, query Query the adlists for a specific domain" echo "::: uninstall Uninstall Pi-Hole from your system :(!" - echo "::: status Is Pi-Hole Enabled or Disabled" - echo "::: enable Enable Pi-Hole DNS Blocking" - echo "::: disable Disable Pi-Hole DNS Blocking" - echo "::: restartdns Restart dnsmasq" + echo "::: status Is Pi-Hole Enabled or Disabled" + echo "::: enable Enable Pi-Hole DNS Blocking" + echo "::: disable Disable Pi-Hole DNS Blocking" + echo "::: restartdns Restart dnsmasq" exit 0 } From 685b775b680f2724076ae52d997d92651049fdd5 Mon Sep 17 00:00:00 2001 From: Tommy Huff Date: Thu, 20 Oct 2016 11:24:34 -0400 Subject: [PATCH 26/40] rework status if statments --- pihole | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pihole b/pihole index afabe9bb..29acfe29 100755 --- a/pihole +++ b/pihole @@ -130,10 +130,10 @@ piholeStatus() { if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=") ]] ; then if [[ "${1}" == "web" ]] ; then echo 0; else echo "::: pihole is Disabled"; fi else - if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then - if [[ "${1}" == "web" ]] ; then echo 1; else echo "::: pihole is Enabled"; fi - else - if [[ "${1}" == "web" ]] ; then echo 1; else + if [[ "${1}" == "web" ]] ; then echo 1; else + if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then + echo "::: pihole is Enabled"; + else echo "::: no hosts file linked to dnsmasq, adding it in enabled state" echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf restartDNS From c0012540ed3cf5897b2d4387665248454a7af2a2 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Thu, 20 Oct 2016 21:08:07 +0100 Subject: [PATCH 27/40] Re-add shebang --- advanced/Scripts/piholeDebug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index a49133fd..bc926495 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -1,4 +1,4 @@ -#/usr/bin/env bash +#!/usr/bin/env bash # Pi-hole: A black hole for Internet advertisements # (c) 2015, 2016 by Jacob Salmela # Network-wide ad blocking via your Raspberry Pi From 78fbafa1cd3a2c21ee1cc1b7b9f69017defdff86 Mon Sep 17 00:00:00 2001 From: tuplink Date: Thu, 20 Oct 2016 18:40:03 -0400 Subject: [PATCH 28/40] test out new status logic --- pihole | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/pihole b/pihole index 29acfe29..7d5f59b5 100755 --- a/pihole +++ b/pihole @@ -127,18 +127,30 @@ piholeEnable() { } piholeStatus() { - if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=") ]] ; then - if [[ "${1}" == "web" ]] ; then echo 0; else echo "::: pihole is Disabled"; fi - else - if [[ "${1}" == "web" ]] ; then echo 1; else - if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=") ]] ; then - echo "::: pihole is Enabled"; - else - echo "::: no hosts file linked to dnsmasq, adding it in enabled state" - echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf - restartDNS - fi + if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=/") ]] ; then + #list is commented out + if [[ "${1}" == "web" ]] ; then + echo 0; + else + echo "::: pihole is Disabled"; fi + elif [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=/") ]] ; then + #list set + if [[ "${1}" == "web" ]] ; then + echo 1; + else + echo "::: pihole is Enabled"; + fi + else + #addn-host not found + if [[ "${1}" == "web" ]] ; then + echo 99 + else + echo "::: no hosts file linked to dnsmasq, adding it in enabled state" + fi + #add addn-host= to dnsmasq + echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf + restartDNS fi } From c83dd3ccd7dfafbd6e843b5a99df4b67de8549d7 Mon Sep 17 00:00:00 2001 From: tuplink Date: Thu, 20 Oct 2016 18:45:27 -0400 Subject: [PATCH 29/40] change spacing --- pihole | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pihole b/pihole index 7d5f59b5..1c7d11e3 100755 --- a/pihole +++ b/pihole @@ -130,25 +130,25 @@ piholeStatus() { if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "#addn-hosts=/") ]] ; then #list is commented out if [[ "${1}" == "web" ]] ; then - echo 0; - else - echo "::: pihole is Disabled"; + echo 0; + else + echo "::: pihole is Disabled"; fi elif [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=/") ]] ; then - #list set - if [[ "${1}" == "web" ]] ; then + #list set + if [[ "${1}" == "web" ]] ; then echo 1; - else - echo "::: pihole is Enabled"; + else + echo "::: pihole is Enabled"; fi else #addn-host not found if [[ "${1}" == "web" ]] ; then - echo 99 - else + echo 99 + else echo "::: no hosts file linked to dnsmasq, adding it in enabled state" - fi - #add addn-host= to dnsmasq + fi + #add addn-host= to dnsmasq echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf restartDNS fi From e199f6db87881ac062a4e31d78a6ba1b3e31841b Mon Sep 17 00:00:00 2001 From: tuplink Date: Thu, 20 Oct 2016 21:15:11 -0400 Subject: [PATCH 30/40] spelling updates --- pihole | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pihole b/pihole index 1c7d11e3..fa5a95f0 100755 --- a/pihole +++ b/pihole @@ -132,21 +132,21 @@ piholeStatus() { if [[ "${1}" == "web" ]] ; then echo 0; else - echo "::: pihole is Disabled"; + echo "::: Pi-hole is Disabled"; fi elif [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=/") ]] ; then #list set if [[ "${1}" == "web" ]] ; then echo 1; else - echo "::: pihole is Enabled"; + echo "::: Pi-hole is Enabled"; fi else #addn-host not found if [[ "${1}" == "web" ]] ; then echo 99 else - echo "::: no hosts file linked to dnsmasq, adding it in enabled state" + echo "::: No hosts file linked to dnsmasq, adding it in enabled state" fi #add addn-host= to dnsmasq echo "addn-hosts=/etc/pihole/gravity.list" >> /etc/dnsmasq.d/01-pihole.conf From 82e78fb6518b47e81f22ee8022677288b70513f5 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 23 Oct 2016 19:44:40 +0100 Subject: [PATCH 31/40] Add output to `pihole disable` and `pihole enable` --- pihole | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pihole b/pihole index 0f0e67c1..6346f32d 100755 --- a/pihole +++ b/pihole @@ -118,8 +118,10 @@ piholeEnable() { if [[ "${1}" == "0" ]] ; then #Disable Pihole sed -i 's/^addn-hosts/#addn-hosts/' /etc/dnsmasq.d/01-pihole.conf + echo "::: Blocking has been disabled!" else #Enable pihole + echo "::: Blocking has been enabled!" sed -i 's/^#addn-hosts/addn-hosts/' /etc/dnsmasq.d/01-pihole.conf fi restartDNS @@ -131,14 +133,14 @@ piholeStatus() { if [[ "${1}" == "web" ]] ; then echo 0; else - echo "::: Pi-hole is Disabled"; + echo "::: Pi-hole blocking is Disabled"; fi elif [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=/") ]] ; then #list set if [[ "${1}" == "web" ]] ; then echo 1; else - echo "::: Pi-hole is Enabled"; + echo "::: Pi-hole blocking is Enabled"; fi else #addn-host not found From 8ee98f0a4aa9b7127e8b1e0955f296ba7340d942 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 23 Oct 2016 19:47:31 +0100 Subject: [PATCH 32/40] remove a space --- pihole | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pihole b/pihole index 6346f32d..9a678393 100755 --- a/pihole +++ b/pihole @@ -133,14 +133,14 @@ piholeStatus() { if [[ "${1}" == "web" ]] ; then echo 0; else - echo "::: Pi-hole blocking is Disabled"; + echo "::: Pi-hole blocking is Disabled"; fi elif [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep "addn-hosts=/") ]] ; then #list set if [[ "${1}" == "web" ]] ; then echo 1; else - echo "::: Pi-hole blocking is Enabled"; + echo "::: Pi-hole blocking is Enabled"; fi else #addn-host not found From b79392ba2c737de2a1759ee0a399dcbbb6578673 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 23 Oct 2016 19:49:51 +0100 Subject: [PATCH 33/40] exit after displaying white/blacklist --- advanced/Scripts/blacklist.sh | 1 + advanced/Scripts/whitelist.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index 10adc2d7..2a088318 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -143,6 +143,7 @@ DisplayBlist() { echo "${count}: ${AD}" count=$((count+1)) done < "${blacklist}" + exit 0; } ################################################### diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 2da6adb0..ee5958bf 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -115,6 +115,7 @@ DisplayWlist() { echo "${count}: ${RD}" count=$((count+1)) done < "${whitelist}" + exit 0; } ################################################### From 96053d13be419ae06f18d0d5b8f73a751283bdb7 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 23 Oct 2016 22:36:50 +0100 Subject: [PATCH 34/40] Flip reload logic. Do not reload lists if no changes made to whitelist.txt --- advanced/Scripts/blacklist.sh | 2 +- advanced/Scripts/whitelist.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index 2a088318..f97e4b9e 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -35,7 +35,7 @@ basename=pihole piholeDir=/etc/${basename} adList=${piholeDir}/gravity.list blacklist=${piholeDir}/blacklist.txt -reload=true +reload=false addmode=true verbose=true diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index ee5958bf..07e976a3 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -36,7 +36,7 @@ basename=pihole piholeDir=/etc/${basename} adList=${piholeDir}/gravity.list whitelist=${piholeDir}/whitelist.txt -reload=true +reload=false addmode=true verbose=true @@ -77,6 +77,7 @@ AddDomain() { if ${verbose}; then echo -n "::: Adding $1 to $whitelist..." fi + reload=true echo "$1" >> ${whitelist} if ${verbose}; then echo " done!" @@ -99,6 +100,7 @@ RemoveDomain() { fi else echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} + reload=true fi } From 476fd1f6959cd19e1914b4daa4d38c9251813fea Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 23 Oct 2016 22:38:18 +0100 Subject: [PATCH 35/40] indentation --- advanced/Scripts/whitelist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 07e976a3..82ff3bb3 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -96,7 +96,7 @@ RemoveDomain() { if ${bool}; then #Domain is not in the whitelist file, no need to Remove if ${verbose}; then - echo "::: $1 is NOT whitelisted! No need to remove" + echo "::: $1 is NOT whitelisted! No need to remove" fi else echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist} From bd0cc134bf1687143182e072aa747e1a4d472f4a Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 23 Oct 2016 22:43:11 +0100 Subject: [PATCH 36/40] MERGE FAIL :ashamed_face: --- advanced/Scripts/blacklist.sh | 116 +++++++++++++--------------------- 1 file changed, 44 insertions(+), 72 deletions(-) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index f97e4b9e..0c780f24 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -35,7 +35,7 @@ basename=pihole piholeDir=/etc/${basename} adList=${piholeDir}/gravity.list blacklist=${piholeDir}/blacklist.txt -reload=false +reload=true addmode=true verbose=true @@ -48,87 +48,58 @@ HandleOther(){ if [ -z "$validDomain" ]; then echo "::: $1 is not a valid argument or domain name" else - domList=("${domList[@]}" ${validDomain}) + domList=("${domList[@]}" ${validDomain}) fi } PopBlacklistFile() { #check blacklist file exists, and if not, create it - if [[ ! -f ${blacklist} ]]; then - touch ${blacklist} + if [[ ! -f ${blacklist} ]];then + touch ${blacklist} fi for dom in "${domList[@]}"; do - if "${addmode}"; then - AddDomain "${dom}" - else - RemoveDomain "${dom}" - fi + if "$addmode"; then + AddDomain "$dom" + else + RemoveDomain "$dom" + fi done } AddDomain() { - #| sed 's/\./\\./g' +#| sed 's/\./\\./g' bool=false grep -Ex -q "$1" ${blacklist} || bool=true if ${bool}; then - #domain not found in the blacklist file, add it! - if ${verbose}; then - echo -n "::: Adding $1 to blacklist file..." - fi - echo "${1}" >> ${blacklist} - modifyHost=true + #domain not found in the blacklist file, add it! + if ${verbose}; then + echo -n "::: Adding $1 to blacklist file..." + fi + echo "$1" >> ${blacklist} echo " done!" else if ${verbose}; then - echo "::: ${1} already exists in ${blacklist}! No need to add" + echo "::: $1 already exists in $blacklist! No need to add" fi fi } RemoveDomain() { - bool=false - grep -Ex -q "$1" ${blacklist} || bool=true - if ${bool}; then - #Domain is not in the blacklist file, no need to Remove - if ${verbose}; then - echo "::: $1 is NOT blacklisted! No need to remove" - fi - else - #Domain is in the blacklist file, remove it - if ${verbose}; then - echo "::: Un-blacklisting ${dom}..." - fi - echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist} - fi -} -ModifyHostFile() { - if ${addmode}; then - #add domains to the hosts file - if [[ -r ${blacklist} ]]; then - numberOf=$(cat ${blacklist} | sed '/^\s*$/d' | wc -l) - plural=; [[ "${numberOf}" != "1" ]] && plural=s - echo ":::" - echo -n "::: Modifying HOSTS file to blacklist $numberOf domain${plural}..." - if [[ -n ${piholeIPv6} ]]; then - cat ${blacklist} | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${adList} - else - cat ${blacklist} | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >>${adList} - fi - fi - else - echo ":::" - for dom in "${domToRemoveList[@]}"; do - #we need to remove the domains from the blacklist file and the host file - echo "::: ${dom}" - echo -n "::: removing from HOSTS file..." - echo "${dom}" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /[^.]'{}'(?!.)/;' ${adList} - echo " done!" - echo -n "::: removing from blackist.txt..." - echo "${dom}" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist} - echo " done!" - done - fi + bool=false + grep -Ex -q "$1" ${blacklist} || bool=true + if ${bool}; then + #Domain is not in the blacklist file, no need to Remove + if ${verbose}; then + echo "::: $1 is NOT blacklisted! No need to remove" + fi + else + #Domain is in the blacklist file,remove it + if ${verbose}; then + echo "::: Un-blacklisting $dom..." + fi + echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist} + fi } Reload() { @@ -139,24 +110,25 @@ DisplayBlist() { verbose=false echo -e " Displaying Gravity Affected Domains \n" count=1 - while IFS= read -r AD; do - echo "${count}: ${AD}" + while IFS= read -r AD + do + echo "${count}: $AD" count=$((count+1)) - done < "${blacklist}" - exit 0; + done < "$blacklist" } ################################################### -for var in "$@"; do - case "$var" in - "-nr"| "--noreload" ) reload=false;; - "-d" | "--delmode" ) addmode=false;; - "-q" | "--quiet" ) verbose=false;; - "-h" | "--help" ) helpFunc;; - "-l" | "--list" ) DisplayBlist;; - * ) HandleOther "$var";; - esac +for var in "$@" +do + case "$var" in + "-nr"| "--noreload" ) reload=false;; + "-d" | "--delmode" ) addmode=false;; + "-q" | "--quiet" ) verbose=false;; + "-h" | "--help" ) helpFunc;; + "-l" | "--list" ) DisplayBlist;; + * ) HandleOther "$var";; + esac done PopBlacklistFile From 7fb622638bba81ff7ff941471b02c7df1f3dda5f Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 23 Oct 2016 22:44:06 +0100 Subject: [PATCH 37/40] flip reload logic. Do not reload if there are not changes made to blacklist.txt --- advanced/Scripts/blacklist.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index 0c780f24..2ce1c674 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -35,7 +35,7 @@ basename=pihole piholeDir=/etc/${basename} adList=${piholeDir}/gravity.list blacklist=${piholeDir}/blacklist.txt -reload=true +reload=false addmode=true verbose=true @@ -76,6 +76,7 @@ AddDomain() { echo -n "::: Adding $1 to blacklist file..." fi echo "$1" >> ${blacklist} + reload=true echo " done!" else if ${verbose}; then @@ -99,6 +100,7 @@ RemoveDomain() { echo "::: Un-blacklisting $dom..." fi echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist} + reload=true fi } From b49384ffe41781511132b056daa5f2d14603428c Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 23 Oct 2016 22:44:21 +0100 Subject: [PATCH 38/40] intent --- advanced/Scripts/blacklist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index 2ce1c674..acf0cf60 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -73,7 +73,7 @@ AddDomain() { if ${bool}; then #domain not found in the blacklist file, add it! if ${verbose}; then - echo -n "::: Adding $1 to blacklist file..." + echo -n "::: Adding $1 to blacklist file..." fi echo "$1" >> ${blacklist} reload=true From f3bf7c4b384941254f0bfa5621cee3b84682312e Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Mon, 24 Oct 2016 14:48:38 -0700 Subject: [PATCH 39/40] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index e265f6d0..53f5b429 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,4 +1,4 @@ -**In raising this issue, I confirm the following (please check boxes, eg [X]):** +**In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:** - [] I have read and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md). - [] The issue I am reporting can be *replicated* From 2f8015cbcaa6541eb1aaf0cfb25084abb8ef2d49 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Mon, 24 Oct 2016 14:50:47 -0700 Subject: [PATCH 40/40] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5f55e443..7291be41 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,4 @@ -**By submitting this pull request, I confirm the following (please check boxes, eg [X]):** +**By submitting this pull request, I confirm the following (please check boxes, eg [X])Failure to fill the template will close your PR:** - [] I have read and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md). - [] I have checked that [another pull request](https://github.com/pi-hole/pi-hole/pulls) for this purpose does not exist.