From 471e9e800d978d541ea08c94d6ad1a3b69375f75 Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Mon, 15 Aug 2022 12:01:19 -0400 Subject: sshd: always run initial apt-get (#96) * sshd: always run initial apt-get * just run apt-update * move * remove whitespace --- src/sshd/devcontainer-feature.json | 2 +- src/sshd/install.sh | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/sshd/devcontainer-feature.json b/src/sshd/devcontainer-feature.json index c21a4f7..32b2b12 100644 --- a/src/sshd/devcontainer-feature.json +++ b/src/sshd/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "sshd", - "version": "1.0.0", + "version": "1.0.1", "name": "SSH server", "description": "Adds a SSH server into a container so that you can use an external terminal, sftp, or SSHFS to interact with it.", "options": { diff --git a/src/sshd/install.sh b/src/sshd/install.sh index 4ee7893..e02ef92 100755 --- a/src/sshd/install.sh +++ b/src/sshd/install.sh @@ -39,21 +39,10 @@ elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then USERNAME=root fi -# Function to run apt-get if needed -apt_get_update_if_needed() -{ - if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then - echo "Running apt-get update..." - apt-get update - else - echo "Skipping apt-get update." - fi -} - # Checks if packages are installed and installs them if not check_packages() { if ! dpkg -s "$@" > /dev/null 2>&1; then - apt_get_update_if_needed + apt-get update -y apt-get -y install --no-install-recommends "$@" fi } -- cgit v1.2.3