Exit script immediately if we can't update package cache.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
@@ -741,7 +741,8 @@ update_package_cache() {
|
|||||||
if eval ${UPDATE_PKG_CACHE} &> /dev/null; then
|
if eval ${UPDATE_PKG_CACHE} &> /dev/null; then
|
||||||
echo " done!"
|
echo " done!"
|
||||||
else
|
else
|
||||||
echo -n "\n!!! ERROR - Unable to update package cache. Please try \"${UPDATE_PKG_CACHE}\""
|
echo -en "\n!!! ERROR - Unable to update package cache. Please try \"${UPDATE_PKG_CACHE}\""
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1209,7 +1210,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Update package cache
|
# Update package cache
|
||||||
update_package_cache
|
update_package_cache || exit 1
|
||||||
|
|
||||||
# Notify user of package availability
|
# Notify user of package availability
|
||||||
notify_package_updates_available
|
notify_package_updates_available
|
||||||
|
Reference in New Issue
Block a user