From c83ea1a706652bce43f3d75ef124c81725207d3e Mon Sep 17 00:00:00 2001 From: aptalca Date: Wed, 16 Jun 2021 17:14:33 -0400 Subject: [PATCH] standardize apt-get --- root/etc/cont-init.d/95-apt-get | 3 +++ root/etc/cont-init.d/98-aws-cli-install | 17 ++++++----------- 2 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 root/etc/cont-init.d/95-apt-get diff --git a/root/etc/cont-init.d/95-apt-get b/root/etc/cont-init.d/95-apt-get new file mode 100644 index 0000000..3a725ea --- /dev/null +++ b/root/etc/cont-init.d/95-apt-get @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv bash + +apt-get update \ No newline at end of file diff --git a/root/etc/cont-init.d/98-aws-cli-install b/root/etc/cont-init.d/98-aws-cli-install index 8391cd1..1453dd6 100644 --- a/root/etc/cont-init.d/98-aws-cli-install +++ b/root/etc/cont-init.d/98-aws-cli-install @@ -4,17 +4,12 @@ echo "*** AWSCLI Installer ***" echo "Checking if awscli is installed" if ! aws -v COMMAND &> /dev/null; then - - echo "aws not installed, installing now..." - - if ! pip -v COMMAND &> /dev/null - then - echo "pip3 not installed, installing now..." - apt-get update - apt-get install python3 python3-pip -y + echo "awscli not installed, installing now..." + if ! pip3 -v COMMAND &> /dev/null; then + echo "pip3 not installed, installing now..." + apt-get install python3 python3-pip -y + fi pip3 install awscli - fi - else - echo "aws installed skipping!" + echo "awscli already installed, skipping!" fi \ No newline at end of file