mirror of
https://github.com/moparisthebest/pi-hole
synced 2024-11-29 04:22:20 -05:00
Merge pull request #42 from hawson/noswap
Allow for local settings to disable swap
This commit is contained in:
commit
2ca9b6b005
16
gravity.sh
16
gravity.sh
@ -19,9 +19,6 @@ sources=('https://adaway.org/hosts.txt'
|
||||
adList=/etc/pihole/gravity.list
|
||||
origin=/etc/pihole
|
||||
piholeDir=/etc/pihole
|
||||
if [[ -f $piholeDir/pihole.conf ]];then
|
||||
. $piholeDir/pihole.conf
|
||||
fi
|
||||
justDomainsExtension=domains
|
||||
matter=pihole.0.matter.txt
|
||||
andLight=pihole.1.andLight.txt
|
||||
@ -34,6 +31,13 @@ latentBlacklist=$origin/latentBlacklist.txt
|
||||
whitelist=$piholeDir/whitelist.txt
|
||||
latentWhitelist=$origin/latentWhitelist.txt
|
||||
|
||||
# After setting defaults, check if there's local overrides
|
||||
if [[ -r $piholeDir/pihole.conf ]];then
|
||||
echo "** Local calibration requested..."
|
||||
. $piholeDir/pihole.conf
|
||||
fi
|
||||
|
||||
|
||||
echo "** Neutrino emissions detected..."
|
||||
|
||||
# Create the pihole resource directory if it doesn't exist. Future files will be stored here
|
||||
@ -55,7 +59,11 @@ function createSwapFile()
|
||||
sudo dphys-swapfile swapon
|
||||
}
|
||||
|
||||
if [[ -f /etc/dphys-swapfile ]];then
|
||||
|
||||
if [[ -n "$noSwap" ]]; then
|
||||
# if $noSwap is set, don't do anything
|
||||
:
|
||||
elif [[ -f /etc/dphys-swapfile ]];then
|
||||
swapSize=$(cat /etc/dphys-swapfile | grep -m1 CONF_SWAPSIZE | cut -d'=' -f2)
|
||||
if [[ $swapSize != 500 ]];then
|
||||
mv /etc/dphys-swapfile /etc/dphys-swapfile.orig
|
||||
|
Loading…
Reference in New Issue
Block a user