1
0
mirror of https://github.com/moparisthebest/pi-hole synced 2024-11-22 01:02:15 -05:00

Resolve merge confict

This commit is contained in:
Dan Schaper 2015-12-06 03:10:29 -08:00
commit 5441591409
2 changed files with 25 additions and 18 deletions

View File

@ -93,7 +93,6 @@ cmd=(whiptail --separate-output --checklist "Select Protocols" $r $c 2)
options=(IPv4 "Block ads over IPv4" on
IPv6 "Block ads over IPv4" off)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices
do
case $choice in
@ -172,15 +171,23 @@ done
fi
}
setStaticIPv4()
{
# Append these lines to /etc/dhcpcd.conf to enable a static IP
setDHCPCD(){
# Append these lines to dhcpcd.conf to enable a static IP
echo "interface $piholeInterface
static ip_address=$IPv4addr
static routers=$IPv4gw
static domain_name_servers=$IPv4gw" | sudo tee -a $dhcpcdFile >/dev/null
}
setStaticIPv4(){
if grep -q $IPv4addr $dhcpcdFile; then
# address already set, noop
:
else
setDHCPCD
sudo ip addr replace dev $piholeInterface $IPv4addr
echo "Setting IP to $IPv4addr. You may need to restart after the install is complete."
fi
}
installScripts(){

View File

@ -13,7 +13,7 @@ if [[ -f $piholeIPfile ]];then
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 '{print $5}')
piholeIPCIDR=$(ip -o -f inet addr show dev $IPv4dev | awk '{print $4}')
piholeIPCIDR=$(ip -o -f inet addr show dev $IPv4dev | awk '{print $4}') | awk 'END {print}')
piholeIP=${piholeIPCIDR%/*}
fi
@ -178,7 +178,7 @@ function gravity_pulsar() {
# regexp so it can be parsed out with grep -x
awk -F '[# \t]' 'NF>0&&$1!="" {print "^"$1"$"}' $whitelist | sed 's/\./\\./g' > $latentWhitelist
else
rm $latentWhitelist
rm $latentWhitelist >/dev/null
fi
# Prevent our sources from being pulled into the hole
@ -235,13 +235,13 @@ function gravity_advanced() {
gravity_unique
sudo kill -HUP $(pidof dnsmasq)
sudo kill -s -HUP $(pidof dnsmasq)
}
gravity_collapse
gravity_spinup
gravity_Schwarzchild
gravity_pulsar
gravity_hostFormat
gravity_advanced
gravity_hostFormat
gravity_blackbody