This commit is contained in:
Bob Mottram 2016-10-31 23:40:54 +00:00
parent 455d4515b3
commit 3c9859d35a
1 changed files with 3 additions and 17 deletions

View File

@ -41,7 +41,7 @@ PIHOLE_DNS2='213.73.91.35'
piholeBasename=pihole piholeBasename=pihole
piholeDir=/etc/$piholeBasename piholeDir=/etc/$piholeBasename
PIHOLE_ADLIST=$piholeDir/gravity.list PIHOLE_ADLIST=$piholeDir/adlists.list
PIHOLE_BLACKLIST=$piholeDir/blacklist.txt PIHOLE_BLACKLIST=$piholeDir/blacklist.txt
PIHOLE_WHITELIST=$piholeDir/whitelist.txt PIHOLE_WHITELIST=$piholeDir/whitelist.txt
@ -59,8 +59,7 @@ function pihole_copy_files {
fi fi
cp $INSTALL_DIR/pihole/adlists.default /etc/.pihole/adlists.default cp $INSTALL_DIR/pihole/adlists.default /etc/.pihole/adlists.default
cp $INSTALL_DIR/pihole/adlists.default $piholeDir/adlists.default cp $INSTALL_DIR/pihole/adlists.default $piholeDir/adlists.default
cp $piholeDir/adlists.default $piholeDir/adlists.list cp $INSTALL_DIR/pihole/adlists.default $PIHOLE_ADLIST
#cp $INSTALL_DIR/pihole/adlists.default $PIHOLE_ADLIST
cp $INSTALL_DIR/pihole/advanced/Scripts/* /opt/$piholeBasename cp $INSTALL_DIR/pihole/advanced/Scripts/* /opt/$piholeBasename
if [ -f /etc/dnsmasq.d/01-pihole.conf ]; then if [ -f /etc/dnsmasq.d/01-pihole.conf ]; then
rm /etc/dnsmasq.d/01-pihole.conf rm /etc/dnsmasq.d/01-pihole.conf
@ -102,8 +101,7 @@ function pihole_update {
echo "piholeDNS1=${PIHOLE_DNS1}" >> ${setupVars} echo "piholeDNS1=${PIHOLE_DNS1}" >> ${setupVars}
echo "piholeDNS2=${PIHOLE_DNS1}" >> ${setupVars} echo "piholeDNS2=${PIHOLE_DNS1}" >> ${setupVars}
echo "addn-hosts=${PIHOLE_ADLIST}" > /etc/dnsmasq.conf echo 'domain-needed' > /etc/dnsmasq.conf
echo 'domain-needed' >> /etc/dnsmasq.conf
echo 'bogus-priv' >> /etc/dnsmasq.conf echo 'bogus-priv' >> /etc/dnsmasq.conf
echo 'no-resolv' >> /etc/dnsmasq.conf echo 'no-resolv' >> /etc/dnsmasq.conf
echo "server=${PIHOLE_DNS1}" >> /etc/dnsmasq.conf echo "server=${PIHOLE_DNS1}" >> /etc/dnsmasq.conf
@ -112,18 +110,6 @@ function pihole_update {
echo 'listen-address=127.0.0.1' >> /etc/dnsmasq.conf echo 'listen-address=127.0.0.1' >> /etc/dnsmasq.conf
echo 'log-queries' >> /etc/dnsmasq.conf echo 'log-queries' >> /etc/dnsmasq.conf
#sed -i "s|@DNS1@|${PIHOLE_DNS1}|g" /etc/dnsmasq.d/01-pihole.conf
#sed -i "s|@DNS2@|${PIHOLE_DNS2}|g" /etc/dnsmasq.d/01-pihole.conf
#sed -i "s|interface=.*|interface=${PIHOLE_IFACE}|g" /etc/dnsmasq.d/01-pihole.conf
#sed -i "s|@IPv4@|${IPv4_address}|g" /etc/dnsmasq.d/01-pihole.conf
#if [ ${#IPv6_address} -gt 0 ]; then
# sed -i "s|@IPv6@|${IPv6_address}|g" /etc/dnsmasq.d/01-pihole.conf
#else
# sed -i '/@IPv6@/d' /etc/dnsmasq.d/01-pihole.conf
#fi
#sed -i "s|@HOSTNAME@|$HOSTNAME|g" /etc/dnsmasq.d/01-pihole.conf
#sed -i "s|addn-hosts=.*|addn-hosts=${PIHOLE_ADLIST}|g" /etc/dnsmasq.d/01-pihole.conf
pihole -g pihole -g
systemctl restart dnsmasq systemctl restart dnsmasq
} }