mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-14 18:32:55 +00:00
Merge conflict resolution
This commit is contained in:
parent
eaf89995ee
commit
f2150ee7e1
4 changed files with 2 additions and 98 deletions
12
README.md
12
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
28
gravity.sh
28
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!
|
||||
|
|
Loading…
Reference in a new issue