diff --git a/images/linux/scripts/helpers/install.sh b/images/linux/scripts/helpers/install.sh index e5cb08006..0f90ac4ae 100644 --- a/images/linux/scripts/helpers/install.sh +++ b/images/linux/scripts/helpers/install.sh @@ -37,9 +37,9 @@ download_with_retries() { ## Use dpkg to figure out if a package has already been installed ## Example use: -## if ! IsInstalled packageName; then +## if ! IsPackageInstalled packageName; then ## echo "packageName is not installed!" ## fi -function IsInstalled { +function IsPackageInstalled { dpkg -S $1 &> /dev/null } \ No newline at end of file diff --git a/images/linux/scripts/installers/build-essential.sh b/images/linux/scripts/installers/build-essential.sh index f84e5857b..34c2ac040 100644 --- a/images/linux/scripts/installers/build-essential.sh +++ b/images/linux/scripts/installers/build-essential.sh @@ -12,7 +12,7 @@ PACKAGE=build-essential # Test to see if the software in question is already installed, if not install it echo "Checking to see if the installer script has already been run" -if ! IsInstalled $PACKAGE; then +if ! IsPackageInstalled $PACKAGE; then echo "Installing $PACKAGE" apt-get install -y --no-install-recommends $PACKAGE else diff --git a/images/linux/scripts/installers/docker-moby.sh b/images/linux/scripts/installers/docker-moby.sh index 8ee78a8c0..9b55e764c 100644 --- a/images/linux/scripts/installers/docker-moby.sh +++ b/images/linux/scripts/installers/docker-moby.sh @@ -17,7 +17,7 @@ fi ## Check to see if docker is already installed echo "Determing if Docker ($docker_package) is installed" -if ! IsInstalled $docker_package; then +if ! IsPackageInstalled $docker_package; then echo "Docker ($docker_package) was not found. Installing..." apt-get remove -y moby-engine moby-cli apt-get update diff --git a/images/linux/scripts/installers/dotnetcore-sdk.sh b/images/linux/scripts/installers/dotnetcore-sdk.sh index 0cd324fe4..c74c34be1 100644 --- a/images/linux/scripts/installers/dotnetcore-sdk.sh +++ b/images/linux/scripts/installers/dotnetcore-sdk.sh @@ -44,7 +44,7 @@ export DOTNET_CLI_TELEMETRY_OPTOUT=1 for latest_package in ${LATEST_DOTNET_PACKAGES[@]}; do echo "Determing if .NET Core ($latest_package) is installed" - if ! IsInstalled $latest_package; then + if ! IsPackageInstalled $latest_package; then echo "Could not find .NET Core ($latest_package), installing..." apt-get install $latest_package -y else diff --git a/images/linux/scripts/installers/hhvm.sh b/images/linux/scripts/installers/hhvm.sh index 97c5c7b1e..e5f9079bc 100644 --- a/images/linux/scripts/installers/hhvm.sh +++ b/images/linux/scripts/installers/hhvm.sh @@ -12,7 +12,7 @@ hhvm_package=hhvm # Test to see if the software in question is already installed, if not install it echo "Checking to see if the installer script has already been run" -if ! IsInstalled ${hhvm_package}; then +if ! IsPackageInstalled ${hhvm_package}; then apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 add-apt-repository https://dl.hhvm.com/ubuntu apt-get update @@ -23,7 +23,7 @@ fi # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" -if ! IsInstalled ${hhvm_package}; then +if ! IsPackageInstalled ${hhvm_package}; then echo "${hhvm_package} was not installed" exit 1 fi