From f2150ee7e102ae55daef3607a7f8388e304ac526 Mon Sep 17 00:00:00 2001 From: nate Date: Mon, 28 Mar 2016 13:07:51 -0500 Subject: [PATCH] Merge conflict resolution --- README.md | 12 +-------- advanced/Scripts/blacklist.sh | 49 +---------------------------------- advanced/Scripts/whitelist.sh | 11 -------- gravity.sh | 28 -------------------- 4 files changed, 2 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index 99fb7547..c58d6820 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,5 @@ -<<<<<<< HEAD -# Automated Install -##### Designed For Raspberry Pi A+, B, B+, 2, Zero (with an Ethernet adapter), and also works on most Debian based distros! -======= # Automated Install -<<<<<<< HEAD -##### Designed For Raspberry Pi A+, B, B+, 2, Zero, and 3B (with an Ethernet/Wi-Fi adapter) ->>>>>>> PiholeDebug -======= -##### Designed For Raspberry Pi A+, B, B+, 2, and Zero (with an Ethernet/Wi-Fi adapter) ->>>>>>> ScriptCleanup ->>>>>>> ScriptCleanup-Dev +##### Designed For Raspberry Pi A+, B, B+, 2, Zero, and 3B (with an Ethernet/Wi-Fi adapter) (Works on most Debian distributions!) 1. Install Raspbian on Raspberry Pi variants or a Debian based distribution on other hardware or virtual machines 2. Run the command below diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index c8a1cfd9..1780b8ec 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -51,19 +51,10 @@ fi function HandleOther(){ #check validity of domain -<<<<<<< HEAD - 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/') - - if [ -z "$validDomain" ]; then - echo $1 is not a valid argument or domain name - else -======= 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/') - if [ -z "$validDomain" ]; then echo "$1" is not a valid argument or domain name else ->>>>>>> ScriptCleanup-Dev domList=("${domList[@]}" $validDomain) fi } @@ -73,16 +64,9 @@ function PopBlacklistFile(){ if [[ ! -f $blacklist ]];then touch $blacklist fi -<<<<<<< HEAD - for dom in "${domList[@]}" - do - if $addmode; then - AddDomain $dom -======= for dom in "${domList[@]}"; do if "$addmode"; then AddDomain "$dom" ->>>>>>> ScriptCleanup-Dev else RemoveDomain "$dom" fi @@ -134,18 +118,6 @@ function ModifyHostFile(){ numberOf=$($blacklist | sed '/^\s*$/d' | wc -l) plural=; [[ "$numberOf" != "1" ]] && plural=s echo ":::" -<<<<<<< HEAD - 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 -n "::: Modifying HOSTS file to blacklist $numberOf domain${plural}..." if [[ -n $piholeIPv6 ]];then $blacklist | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> $adList @@ -154,22 +126,10 @@ function ModifyHostFile(){ fi fi else ->>>>>>> ScriptCleanup-Dev echo ":::" - for dom in "${domToRemoveList[@]}" + for dom in "${domToRemoveList[@]}" do #we need to remove the domains from the blacklist file and the host file -<<<<<<< HEAD - 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 -======= echo "::: $dom" echo -n "::: removing from HOSTS file..." echo "$dom" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /[^.]'{}'(?!.)/;' $adList @@ -179,8 +139,6 @@ function ModifyHostFile(){ echo " done!" done fi ->>>>>>> ScriptCleanup-Dev - } function Reload() { @@ -208,13 +166,8 @@ do "-nr"| "--noreload" ) reload=false;; "-d" | "--delmode" ) addmode=false;; "-f" | "--force" ) force=true;; -<<<<<<< HEAD - "-q" | "--quiet" ) versbose=false;; - * ) HandleOther $var;; -======= "-q" | "--quiet" ) versbose=false;; * ) HandleOther "$var";; ->>>>>>> ScriptCleanup-Dev esac done diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 3a30d11a..5d732ddc 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -51,13 +51,7 @@ fi function HandleOther(){ #check validity of domain -<<<<<<< HEAD - 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/') - -======= 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/') - ->>>>>>> ScriptCleanup-Dev if [ -z "$validDomain" ]; then echo "::: $1 is not a valid argument or domain name" else @@ -186,13 +180,8 @@ do "-nr"| "--noreload" ) reload=false;; "-d" | "--delmode" ) addmode=false;; "-f" | "--force" ) force=true;; -<<<<<<< HEAD - "-q" | "--quiet" ) versbose=false;; - * ) HandleOther $var;; -======= "-q" | "--quiet" ) versbose=false;; * ) HandleOther "$var";; ->>>>>>> ScriptCleanup-Dev esac done diff --git a/gravity.sh b/gravity.sh index a8ac7029..531ae4c1 100755 --- a/gravity.sh +++ b/gravity.sh @@ -169,22 +169,12 @@ function gravity_transport() { fi # Silently curl url -<<<<<<< HEAD curl -s $cmd_ext $heisenbergCompensator -A "$agent" $url > $patternBuffer # Check for list updates gravity_patternCheck $patternBuffer -======= -<<<<<<< HEAD - curl -s $cmd_ext $heisenbergCompensator -A "$agent" $url > $patternBuffer - # Check for list updates - gravity_patternCheck $patternBuffer -======= curl -s "$cmd_ext" "$heisenbergCompensator" -A "$agent" "$url" > "$patternBuffer" # Check for list updates gravity_patternCheck "$patternBuffer" ->>>>>>> ScriptCleanup ->>>>>>> ScriptCleanup-Dev - # Cleanup rm -f "$patternBuffer" } @@ -269,16 +259,7 @@ function gravity_Whitelist() { echo " done!" echo -n "::: Running whitelist script to update HOSTS file...." -<<<<<<< HEAD - $whitelistScript -f -nr -q ${urls[@]} > /dev/null & spinner $! - -<<<<<<< HEAD -======= -======= $whitelistScript -f -nr -q "${urls[@]}" > /dev/null & spinner $! - ->>>>>>> ScriptCleanup ->>>>>>> ScriptCleanup-Dev numWhitelisted=$(wc -l < "/etc/pihole/whitelist.txt") plural=; [[ "$numWhitelisted" != "1" ]] && plural=s echo " $numWhitelisted domain${plural} whitelisted!" @@ -303,16 +284,7 @@ function gravity_hostFormat() { if [[ -n $piholeIPv6 ]];then #Add dummy domain Pi-Hole.IsWorking.OK to the top of gravity.list to make ping result return a friendlier looking domain! echo -e "$piholeIP Pi-Hole.IsWorking.OK \n$piholeIPv6 Pi-Hole.IsWorking.OK" > $piholeDir/$accretionDisc -<<<<<<< HEAD - cat $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> $piholeDir/$accretionDisc - -<<<<<<< HEAD -======= -======= $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> $piholeDir/$accretionDisc - ->>>>>>> ScriptCleanup ->>>>>>> ScriptCleanup-Dev else # Otherwise, just create gravity.list as normal using IPv4 #Add dummy domain Pi-Hole.IsWorking.OK to the top of gravity.list to make ping result return a friendlier looking domain!