Unverified Commit 471e9e80 authored by Josh Spicer's avatar Josh Spicer Committed by GitHub

sshd: always run initial apt-get (#96)

* sshd: always run initial apt-get

* just run apt-update

* move

* remove whitespace
parent 255d403f
{
"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": {
......
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment