From 46d7bfecdb6e2c7c4ab5bf40d0236b768bf10771 Mon Sep 17 00:00:00 2001 From: Daniel Fayette Date: Wed, 10 Feb 2016 09:34:06 -0600 Subject: [PATCH 1/7] Check for 25mb of free disk space before install Function will check the free space of / (root) If the free space is less than 25MB it will give directions on how to expand the disk. Fixes #163 --- automated install/basic-install.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index bc027cbd..a0f0ebcb 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -115,6 +115,20 @@ welcomeDialogs() { In the next section, you can choose to use your current network settings (DHCP) or to manually edit them." $r $c } + +verifyFreeDiskSpace() { + # 25MB is the minimum space needed (20MB install + 5MB one day of logs.) + requiredFreeBytes=25600 + + existingFreeBytes=`df -lkP / | awk '{print $4}' | tail -1` + + if [[ $existingFreeBytes -lt $requiredFreeBytes ]]; then + whiptail --msgbox --backtitle "Insufficient Disk Space" --title "Insufficient Disk Space" "\nYour system appears to be low on disk space. pi-hole recomends a minimum of $requiredFreeBytes Bytes.\nYou only have $existingFreeBytes Free.\n\nIf this is a new install you may need to expand your disk.\n\nTry running:\n 'sudo raspi-config'\nChoose the 'expand file system option'\n\nAfter rebooting, run this installation again.\n\ncurl -L install.pi-hole.net | bash\n" $r $c + exit 1 + fi +} + + chooseInterface() { # Turn the available interfaces into an array so it can be used with a whiptail dialog interfacesArray=() @@ -557,6 +571,9 @@ The install log is in /etc/pihole." $r $c $SUDO mkdir -p /etc/pihole/ welcomeDialogs +# Verify there is enough disk space for the install +verifyFreeDiskSpace + # Just back up the original Pi-hole right away since it won't take long and it gets it out of the way backupLegacyPihole # Find interfaces and let the user choose one From 68a9b88b58ebbe59870f7316f64d386d94529ccd Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Sun, 14 Feb 2016 10:20:02 -0600 Subject: [PATCH 2/7] docker container for Pi-hole --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7e938834..207375f2 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Once installed, [configure your router to have **DHCP clients use the Pi as thei [![Pi-hole exlplained](http://i.imgur.com/qNybJDX.png)](https://vimeo.com/135965232) ## Pi-hole Projects +- [x86 Docker container that runs Pi-hole](https://hub.docker.com/r/diginc/pi-hole/) - [Pi-hole Chrome extension](https://chrome.google.com/webstore/detail/pi-hole-list-editor/hlnoeoejkllgkjbnnnhfolapllcnaglh) ([open source](https://github.com/packtloss/pihole-extension)) - [Go Bananas for CHiP-hole ad blocking](https://www.hackster.io/jacobsalmela/chip-hole-network-wide-ad-blocker-98e037) - [Sky-Hole](http://dlaa.me/blog/post/skyhole) From 3a887af513295a03d754edfe13e5070c400e01e1 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 14 Feb 2016 22:24:21 +0000 Subject: [PATCH 3/7] Addresses #313 path to white and blacklist scripts moved to variables and updated to include full path --- gravity.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index 948c06f3..6e620d4d 100755 --- a/gravity.sh +++ b/gravity.sh @@ -31,6 +31,8 @@ piholeIPv6file=/etc/pihole/.useIPv6 adListFile=/etc/pihole/adlists.list adListDefault=/etc/pihole/adlists.default +whitelistScript=/usr/local/bin/whitelist.sh +blacklistScript=/usr/local/bin/blacklist.sh if [[ -f $piholeIPfile ]];then # If the file exists, it means it was exported from the installation script and we should use that value instead of detecting it in this script @@ -220,7 +222,7 @@ function gravity_Schwarzchild() { function gravity_Blacklist(){ # Append blacklist entries if they exist echo -n "::: Running blacklist script to update HOSTS file...." - blacklist.sh -f -nr -q > /dev/null & spinner $! + $blacklistScript -f -nr -q > /dev/null & spinner $! numBlacklisted=$(wc -l < "/etc/pihole/blacklist.txt") plural=; [[ "$numBlacklisted" != "1" ]] && plural=s @@ -245,7 +247,7 @@ function gravity_Whitelist() { echo " done!" echo -n "::: Running whitelist script to update HOSTS file...." - whitelist.sh -f -nr -q ${urls[@]} > /dev/null & spinner $! + $whitelistScript -f -nr -q ${urls[@]} > /dev/null & spinner $! numWhitelisted=$(wc -l < "/etc/pihole/whitelist.txt") plural=; [[ "$numWhitelisted" != "1" ]] && plural=s From 4d0b4cfb36f0cf5592449323e9c2bfcc1cb71012 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 14 Feb 2016 23:44:23 +0000 Subject: [PATCH 4/7] Update basic-install.sh Do not stop dnsmasq when installing. Instead run `service dnsmasq restart` once installation is complete. This may have been the cause of issues outlined in #218 --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 359a1f0d..514ac8e6 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -387,7 +387,7 @@ stopServices() { # Stop dnsmasq and lighttpd $SUDO echo ":::" $SUDO echo -n "::: Stopping services..." - $SUDO service dnsmasq stop & spinner $! || true + #$SUDO service dnsmasq stop & spinner $! || true $SUDO service lighttpd stop & spinner $! || true $SUDO echo " done." } @@ -601,7 +601,7 @@ displayFinalMessage echo -n "::: Restarting services..." # Start services -$SUDO service dnsmasq start +$SUDO service dnsmasq restart $SUDO service lighttpd start echo " done." From 06444c1c27b37f6347b3504559c86139a5faa2bf Mon Sep 17 00:00:00 2001 From: slamanna212 Date: Mon, 15 Feb 2016 17:31:31 -0500 Subject: [PATCH 5/7] Add 3 More DNS Server Choices Durring Install Added Level 3 , Norton, and Comodo DNS Choices --- automated install/basic-install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 514ac8e6..35bcec41 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -316,6 +316,21 @@ setDNS(){ piholeDNS1="208.67.222.222" piholeDNS2="208.67.220.220" ;; + Level3) + echo "::: Using Level3 servers." + piholeDNS1="4.2.2.1" + piholeDNS2="4.2.2.2" + ;; + Norton) + echo "::: Using Norton ConnectSafe servers." + piholeDNS1="199.85.126.10" + piholeDNS2="199.85.127.10" + ;; + Comodo) + echo "::: Using Comodo Secure servers." + piholeDNS1="8.26.56.26" + piholeDNS2="8.20.247.20" + ;; esac else echo "::: Cancel selected. Exiting..." From 94600c54cbaac14e6e7c0e32b06fce9cddc7b624 Mon Sep 17 00:00:00 2001 From: slamanna212 Date: Mon, 15 Feb 2016 17:54:17 -0500 Subject: [PATCH 6/7] Added Default State for New DNS Options Added default state of off for 3 new DNS options to better match existing code --- automated install/basic-install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 35bcec41..84ba3921 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -302,7 +302,10 @@ setStaticIPv4() { setDNS(){ DNSChoseCmd=(whiptail --separate-output --radiolist "Select Upstream DNS Provider" $r $c 2) DNSChooseOptions=(Google "" on - OpenDNS "" off) + OpenDNS "" off + Level3 "" off + Norton "" off + Comodo "" off) DNSchoices=$("${DNSChoseCmd[@]}" "${DNSChooseOptions[@]}" 2>&1 >/dev/tty) if [[ $? = 0 ]];then case $DNSchoices in From da959e1296761c3e70d5ab3b812c649fd4424d2b Mon Sep 17 00:00:00 2001 From: slamanna212 Date: Mon, 15 Feb 2016 17:55:14 -0500 Subject: [PATCH 7/7] Increased Size Of Whiptail Dialog Increased Size of Whiptail Dialog to 5 to show all 5 DNS choices --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 84ba3921..23aa827f 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -300,7 +300,7 @@ setStaticIPv4() { } setDNS(){ - DNSChoseCmd=(whiptail --separate-output --radiolist "Select Upstream DNS Provider" $r $c 2) + DNSChoseCmd=(whiptail --separate-output --radiolist "Select Upstream DNS Provider" $r $c 5) DNSChooseOptions=(Google "" on OpenDNS "" off Level3 "" off