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 options=(IPv4 "Block ads over IPv4" on
IPv6 "Block ads over IPv4" off) IPv6 "Block ads over IPv4" off)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty) choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices for choice in $choices
do do
case $choice in case $choice in
@ -172,15 +171,23 @@ done
fi fi
} }
setDHCPCD(){
setStaticIPv4() # Append these lines to dhcpcd.conf to enable a static IP
{
# Append these lines to /etc/dhcpcd.conf to enable a static IP
echo "interface $piholeInterface echo "interface $piholeInterface
static ip_address=$IPv4addr static ip_address=$IPv4addr
static routers=$IPv4gw static routers=$IPv4gw
static domain_name_servers=$IPv4gw" | sudo tee -a $dhcpcdFile >/dev/null static domain_name_servers=$IPv4gw" | sudo tee -a $dhcpcdFile >/dev/null
sudo ip addr replace dev $piholeInterface $IPv4addr }
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(){ installScripts(){

View File

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