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:
parent
94795db7e9
commit
696895fa59
|
@ -52,7 +52,9 @@ ensure_basic_configuration() {
|
||||||
# chown pihole:root "${PI_HOLE_BIN_DIR}/pihole"
|
# chown pihole:root "${PI_HOLE_BIN_DIR}/pihole"
|
||||||
|
|
||||||
mkdir -p /etc/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
|
chown -R pihole:pihole /etc/pihole
|
||||||
|
|
||||||
|
|
||||||
|
|
30
src/start.sh
30
src/start.sh
|
@ -98,24 +98,26 @@ start() {
|
||||||
|
|
||||||
/usr/sbin/crond
|
/usr/sbin/crond
|
||||||
|
|
||||||
#migrate Database if needed:
|
#migrate Database if needed:
|
||||||
gravityDBfile=$(getFTLConfigValue files.gravity)
|
gravityDBfile=$(getFTLConfigValue files.gravity)
|
||||||
if [ -n "${SKIPGRAVITYONBOOT}" ]; then
|
|
||||||
if [ -f "${gravityDBfile}" ]; then
|
if [ ! -f "${gravityDBfile}" ]; then
|
||||||
#skip set + file =>update if needed
|
if [ -n "${SKIPGRAVITYONBOOT}" ]; then
|
||||||
echo " Skipping Gravity Database Update."
|
|
||||||
# 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 " 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."
|
echo " Ignoring SKIPGRAVITYONBOOT on this occasion."
|
||||||
pihole -g
|
unset SKIPGRAVITYONBOOT
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo " Skipping Gravity Database Update."
|
|
||||||
fi
|
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"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${SKIPGRAVITYONBOOT}" ]; then
|
||||||
|
echo " Skipping Gravity Database Update."
|
||||||
|
else
|
||||||
|
pihole -g
|
||||||
|
fi
|
||||||
|
|
||||||
pihole updatechecker
|
pihole updatechecker
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue