Skip to content

Commit 7116634

Browse files
committed
Merge branch 'development' for release 2.5.2
2 parents 68a9b88 + 36492f4 commit 7116634

File tree

4 files changed

+57
-6
lines changed

4 files changed

+57
-6
lines changed

adlists.default

+9
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@ http://pgl.yoyo.org/adservers/serverlist.php?
66
http://someonewhocares.org/hosts/hosts
77
http://winhelp2002.mvps.org/hosts.txt
88
http://mirror1.malwaredomains.com/files/justdomains
9+
http://securemecca.com/Downloads/hosts.txt
10+
https://hosts.neocities.org/
11+
http://sysctl.org/cameleon/hosts
12+
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
13+
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
14+
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
15+
http://optimate.dl.sourceforge.net/project/adzhosts/HOSTS.txt
16+
https://raw.githubusercontent.com/quidsup/notrack/master/trackers.txt
17+

advanced/Scripts/chronometer.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ function CalcblockedToday(){
5151

5252
function CalcPercentBlockedToday(){
5353
if [ "$queriesToday" != "Err." ] && [ "$blockedToday" != "Err." ]; then
54-
#scale 2 rounds the number down, so we'll do scale 4 and then trim the last 2 zeros
55-
percentBlockedToday=$(echo "scale=4; $blockedToday/$queriesToday*100" | bc)
56-
percentBlockedToday=$(sed 's/.\{2\}$//' <<< "$percentBlockedToday")
54+
if [ "$queriesToday" != 0 ]; then #Fixes divide by zero error :)
55+
#scale 2 rounds the number down, so we'll do scale 4 and then trim the last 2 zeros
56+
percentBlockedToday=$(echo "scale=4; $blockedToday/$queriesToday*100" | bc)
57+
percentBlockedToday=$(sed 's/.\{2\}$//' <<< "$percentBlockedToday")
58+
else
59+
percentBlockedToday=0
60+
fi
5761
fi
5862
}
5963

automated install/basic-install.sh

+36
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ welcomeDialogs() {
115115
In the next section, you can choose to use your current network settings (DHCP) or to manually edit them." $r $c
116116
}
117117

118+
119+
verifyFreeDiskSpace() {
120+
# 25MB is the minimum space needed (20MB install + 5MB one day of logs.)
121+
requiredFreeBytes=25600
122+
123+
existingFreeBytes=`df -lkP / | awk '{print $4}' | tail -1`
124+
125+
if [[ $existingFreeBytes -lt $requiredFreeBytes ]]; then
126+
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
127+
exit 1
128+
fi
129+
}
130+
131+
118132
chooseInterface() {
119133
# Turn the available interfaces into an array so it can be used with a whiptail dialog
120134
interfacesArray=()
@@ -148,6 +162,12 @@ chooseInterface() {
148162

149163
}
150164

165+
cleanupIPv6() {
166+
# Removes IPv6 indicator file if we are not using IPv6
167+
if [ -f "/etc/pihole/.useIPv6" ] && [ ! $useIPv6 ]; then
168+
rm /etc/pihole/.useIPv6
169+
fi
170+
}
151171

152172
use4andor6() {
153173
# Let use select IPv4 and/or IPv6
@@ -187,6 +207,7 @@ use4andor6() {
187207
echo "::: Exiting"
188208
exit 1
189209
fi
210+
cleanupIPv6
190211
else
191212
echo "::: Cancel selected. Exiting..."
192213
exit 1
@@ -557,6 +578,9 @@ The install log is in /etc/pihole." $r $c
557578
$SUDO mkdir -p /etc/pihole/
558579
welcomeDialogs
559580

581+
# Verify there is enough disk space for the install
582+
verifyFreeDiskSpace
583+
560584
# Just back up the original Pi-hole right away since it won't take long and it gets it out of the way
561585
backupLegacyPihole
562586
# Find interfaces and let the user choose one
@@ -575,6 +599,18 @@ $SUDO mv $tmpLog $instalLogLoc
575599

576600
displayFinalMessage
577601

602+
echo -n "::: Restarting services..."
578603
# Start services
579604
$SUDO service dnsmasq start
580605
$SUDO service lighttpd start
606+
echo " done."
607+
608+
echo ":::"
609+
echo "::: Installation Complete! Configure your devices to use the Pi-hole as their DNS server using:"
610+
echo "::: $IPv4addr"
611+
echo "::: $piholeIPv6"
612+
echo ":::"
613+
echo "::: If you set a new IP address, you should restart the Pi."
614+
echo "::: "
615+
echo "::: The install log is located at: /etc/pihole/install.log"
616+

gravity.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ piholeIPv6file=/etc/pihole/.useIPv6
3131

3232
adListFile=/etc/pihole/adlists.list
3333
adListDefault=/etc/pihole/adlists.default
34+
whitelistScript=/usr/local/bin/whitelist.sh
35+
blacklistScript=/usr/local/bin/blacklist.sh
3436

3537
if [[ -f $piholeIPfile ]];then
3638
# 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
@@ -198,7 +200,7 @@ function gravity_spinup() {
198200
# Default is a simple request
199201
*) cmd_ext=""
200202
esac
201-
gravity_transport $url $cmd_ext $agent
203+
gravity_transport "$url" "$cmd_ext" "$agent"
202204
done
203205
}
204206

@@ -220,7 +222,7 @@ function gravity_Schwarzchild() {
220222
function gravity_Blacklist(){
221223
# Append blacklist entries if they exist
222224
echo -n "::: Running blacklist script to update HOSTS file...."
223-
blacklist.sh -f -nr -q > /dev/null & spinner $!
225+
$blacklistScript -f -nr -q > /dev/null & spinner $!
224226

225227
numBlacklisted=$(wc -l < "/etc/pihole/blacklist.txt")
226228
plural=; [[ "$numBlacklisted" != "1" ]] && plural=s
@@ -245,7 +247,7 @@ function gravity_Whitelist() {
245247
echo " done!"
246248

247249
echo -n "::: Running whitelist script to update HOSTS file...."
248-
whitelist.sh -f -nr -q ${urls[@]} > /dev/null & spinner $!
250+
$whitelistScript -f -nr -q ${urls[@]} > /dev/null & spinner $!
249251

250252
numWhitelisted=$(wc -l < "/etc/pihole/whitelist.txt")
251253
plural=; [[ "$numWhitelisted" != "1" ]] && plural=s

0 commit comments

Comments
 (0)