diff --git a/CT-Build/Debian.yaml b/CT-Build/Debian.yaml index 83005d0..e73c302 100644 --- a/CT-Build/Debian.yaml +++ b/CT-Build/Debian.yaml @@ -1339,33 +1339,26 @@ packages: #pihole pkgs - packages: + - grep - grep - dnsutils + - binutils - git - iproute2 - - whiptail + - dialog - cron - curl - iputils-ping - - lsof - - netcat-openbsd - psmisc - sudo - unzip - - idn2 - - sqlite3 - libcap2-bin - dns-root-data - libcap2 - - jq + - netcat-openbsd - procps - - lighttpd - - php-common - - php-cli - - php-cgi - - php-sqlite3 - - php-xml - - php-intl + - jq + - lshw action: install variants: - pihole diff --git a/CT-Files/pihole/Configs/lighthttpd-redirect.conf b/CT-Files/pihole/Configs/lighthttpd-redirect.conf deleted file mode 100644 index 6d932dd..0000000 --- a/CT-Files/pihole/Configs/lighthttpd-redirect.conf +++ /dev/null @@ -1 +0,0 @@ -url.redirect = ("^/$" => "/admin" ) \ No newline at end of file diff --git a/CT-Files/pihole/Configs/pihole.toml b/CT-Files/pihole/Configs/pihole.toml new file mode 100644 index 0000000..fb208f4 --- /dev/null +++ b/CT-Files/pihole/Configs/pihole.toml @@ -0,0 +1,28 @@ +# Pi-hole configuration file (v6.1) +# Encoding: UTF-8 + +[dns] + upstreams = [ + "9.9.9.9", + "149.112.112.112" + ] + piholePTR = "HOSTNAME" + + listeningMode = "SINGLE" + + domainNeeded = true + + [ntp.ipv4] + active = false + + [ntp.ipv6] + active = false + + [ntp.sync] + active = false + + [ntp.sync.rtc] + utc = false + +[webserver] + port = "80o,[::]:80o" \ No newline at end of file diff --git a/CT-Files/pihole/Configs/setupVars.conf b/CT-Files/pihole/Configs/setupVars.conf deleted file mode 100644 index c609f51..0000000 --- a/CT-Files/pihole/Configs/setupVars.conf +++ /dev/null @@ -1,7 +0,0 @@ -WEBPASSWORD= -QUERY_LOGGING=true -INSTALL_WEB=true -DNSMASQ_LISTENING=single -PIHOLE_DNS_1=192.168.2.1 -PIHOLE_DNS_2=192.168.2.1 -TEMPERATUREUNIT=C diff --git a/CT-Files/pihole/Scripts/FirstRun.sh b/CT-Files/pihole/Scripts/FirstRun.sh index 59c75fe..cc1e6a8 100644 --- a/CT-Files/pihole/Scripts/FirstRun.sh +++ b/CT-Files/pihole/Scripts/FirstRun.sh @@ -1,5 +1,17 @@ #!/bin/bash +read -p "IP for the upstream dns server: " UpStreamDNS1 + +while true; do + read -p "Add seconndary upstream dns server Y/N? " yn + case $yn in + [Yy]* ) read -p "IP for second the upstream dns server: " UpStreamDNS2;break;; + [Nn]* ) UpStreamDNS2=$UpStreamDNS1;break;; + * ) echo "Please answer yes or no.";; + esac +done + +sed -i "/upstreams = \[/,/\]/c\upstreams = [ \"$UpStreamDNS1\" , \"$UpStreamDNS2\" ]" /etc/pihole/pihole.toml #Finialize instaltation /etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended #Set password -pihole -a -p \ No newline at end of file +pihole setpassword \ No newline at end of file diff --git a/CT-Files/pihole/Scripts/Init.sh b/CT-Files/pihole/Scripts/Init.sh index 58c8de8..577ba06 100644 --- a/CT-Files/pihole/Scripts/Init.sh +++ b/CT-Files/pihole/Scripts/Init.sh @@ -1,9 +1,9 @@ #!/bin/sh mkdir -p /etc/pihole -mv /opt/Setup/Configs/setupVars.conf /etc/pihole/setupVars.conf -mv /opt/Setup/Configs/lighthttpd-redirect.conf /etc/lighttpd/conf-available/14-root-redirect.conf -ln -s ../conf-available/14-root-redirect.conf /etc/lighttpd/conf-enabled/14-root-redirect.conf +mv /opt/Setup/Configs/pihole.toml /etc/pihole/pihole.toml echo "DNSStubListener=no" >> /etc/systemd/resolved.conf ln -s /etc/systemd/system/pihole-FTL.service /etc/systemd/system/multi-user.target.wants/pihole-FTL.service -curl -sSL https://install.pi-hole.net | bash /dev/stdin --unattended || true \ No newline at end of file +curl -sSL https://install.pi-hole.net | bash /dev/stdin --unattended || true + +rm -rf /opt/Setup/Configs \ No newline at end of file diff --git a/CT-Files/pihole/Scripts/PTKAppUpdate.sh b/CT-Files/pihole/Scripts/PTKAppUpdate.sh index cc1d504..19fd13c 100644 --- a/CT-Files/pihole/Scripts/PTKAppUpdate.sh +++ b/CT-Files/pihole/Scripts/PTKAppUpdate.sh @@ -1,3 +1,3 @@ #!/bin/sh # Update script for updating apps with ProxmoxHelper/ProxMoxToolKit -/usr/local/bin/pihole -up \ No newline at end of file +/usr/local/bin/pihole updatePihole \ No newline at end of file