diff options
Diffstat (limited to 'src/php/install.sh')
-rwxr-xr-x | src/php/install.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/php/install.sh b/src/php/install.sh index fdc374a..70b63da 100755 --- a/src/php/install.sh +++ b/src/php/install.sh @@ -8,6 +8,9 @@ set -eux +# Clean up +rm -rf /var/lib/apt/lists/* + VERSION=${VERSION:-"latest"} INSTALL_COMPOSER=${INSTALLCOMPOSER:-"true"} OVERRIDE_DEFAULT_VERSION=${OVERRIDEDEFAULTVERSION:-"true"} @@ -73,7 +76,10 @@ updaterc() { # Checks if packages are installed and installs them if not check_packages() { if ! dpkg -s "$@" > /dev/null 2>&1; then - apt-get update + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi apt-get -y install --no-install-recommends "$@" fi } @@ -222,4 +228,7 @@ chown -R "${USERNAME}:php" "${PHP_DIR}" chmod -R g+r+w "${PHP_DIR}" find "${PHP_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s +# Clean up +rm -rf /var/lib/apt/lists/* + echo "Done!" |