Skip to content

Commit

Permalink
Remember if package cache has been updated before. If so, skip it
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed May 12, 2024
1 parent 3abd2c0 commit b5e4a16
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions automated install/basic-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ PI_HOLE_FILES=(list piholeDebug piholeLogFlush setupLCD update version gravity u
PI_HOLE_INSTALL_DIR="/opt/pihole"
PI_HOLE_CONFIG_DIR="/etc/pihole"
PI_HOLE_BIN_DIR="/usr/local/bin"
PKG_MANAGER_UPDATE=false
if [ -z "$useUpdateVars" ]; then
useUpdateVars=false
fi
Expand Down Expand Up @@ -1297,6 +1298,12 @@ update_package_cache() {
# Update package cache on apt based OSes. Do this every time since
# it's quick and packages can be updated at any time.

# Update package cache only once
if [[ "${PKG_MANAGER_UPDATE}" == "true" ]]; then
return
fi
PKG_MANAGER_UPDATE=true

# Local, named variables
local str="Update local cache of available packages"
printf " %b %s..." "${INFO}" "${str}"
Expand Down

0 comments on commit b5e4a16

Please sign in to comment.