Handle an empty local.list

Handle the case of an empty local.list file which would otherwise prevent the system from starting

Change-type: patch
Signed-off-by: Chris Crocker-White <chriscw@balena.io>
This commit is contained in:
Chris Crocker-White 2019-05-27 10:27:28 -07:00
parent cad9386ff6
commit 69dba022c4

View file

@ -184,8 +184,8 @@ migrate_to_database() {
gravity_CheckDNSResolutionAvailable() { gravity_CheckDNSResolutionAvailable() {
local lookupDomain="pi.hole" local lookupDomain="pi.hole"
# Determine if $localList does not exist # Determine if $localList does not exist, and ensure it is not empty
if [[ ! -e "${localList}" ]]; then if [[ ! -e "${localList}" ]] || [[ -s "${localList}" ]]; then
lookupDomain="raw.githubusercontent.com" lookupDomain="raw.githubusercontent.com"
fi fi