mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-20 02:18:51 +00:00
Fix some broken logic in the gravity skip code (I should have read it better)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
@@ -52,7 +52,9 @@ ensure_basic_configuration() {
|
||||
# chown pihole:root "${PI_HOLE_BIN_DIR}/pihole"
|
||||
|
||||
mkdir -p /etc/pihole
|
||||
echo "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" >> /etc/pihole/adlists.list
|
||||
if [[ ! -f /etc/pihole/adlists.list ]]; then
|
||||
echo "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" > /etc/pihole/adlists.list
|
||||
fi
|
||||
chown -R pihole:pihole /etc/pihole
|
||||
|
||||
|
||||
|
||||
22
src/start.sh
22
src/start.sh
@@ -98,23 +98,25 @@ start() {
|
||||
|
||||
/usr/sbin/crond
|
||||
|
||||
#migrate Database if needed:
|
||||
#migrate Database if needed:
|
||||
gravityDBfile=$(getFTLConfigValue files.gravity)
|
||||
|
||||
if [ ! -f "${gravityDBfile}" ]; then
|
||||
if [ -n "${SKIPGRAVITYONBOOT}" ]; then
|
||||
if [ -f "${gravityDBfile}" ]; then
|
||||
#skip set + file =>update if needed
|
||||
echo " Skipping Gravity Database Update."
|
||||
echo " SKIPGRAVITYONBOOT is set, however ${gravityDBfile} does not exist (Likely due to a fresh volume). This is a required file for Pi-hole to operate."
|
||||
echo " Ignoring SKIPGRAVITYONBOOT on this occasion."
|
||||
unset SKIPGRAVITYONBOOT
|
||||
fi
|
||||
else
|
||||
# TODO: Revisit this path if we move to a multistage build
|
||||
source /etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh
|
||||
upgrade_gravityDB "${gravityDBfile}" "/etc/pihole"
|
||||
else
|
||||
#skip set + nofile => pihole -g (install error)
|
||||
echo " SKIPGRAVITYONBOOT is set, however ${gravityDBfile} does not exist (Likely due to a fresh volume). This is a required file for Pi-hole to operate."
|
||||
echo " Ignoring SKIPGRAVITYONBOOT on this occasion."
|
||||
pihole -g
|
||||
fi
|
||||
else
|
||||
|
||||
if [ -n "${SKIPGRAVITYONBOOT}" ]; then
|
||||
echo " Skipping Gravity Database Update."
|
||||
else
|
||||
pihole -g
|
||||
fi
|
||||
|
||||
pihole updatechecker
|
||||
|
||||
Reference in New Issue
Block a user