J7a4s0m5ine / docker-debian-installer

A shell script to install docker on any debian distro (Ubuntu, Debian, Parrot, Tails, Raspbian, etc)
GNU General Public License v2.0
6 stars 1 forks source link

Keyfile Check #8

Open J7a4s0m5ine opened 1 year ago

J7a4s0m5ine commented 1 year ago

Need to check for keyfile to avoid issues down the line

KEYFILE="/etc/apt/keyrings/docker.gpg"
if [ -f "$KEYFILE" ]; then
  MESSAGE="Keyfile for Docker exists...continuing..." ; blue_echo
else
  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
fi
J7a4s0m5ine commented 1 year ago

https://github.com/C922A10971734/docker-debian-installer/issues/1 Related.

J7a4s0m5ine commented 1 year ago

Actually on some installs the keyring folder altogether might not exist iirc.

KEYDIR="/etc/apt/keyrings"
if [ -d "$KEYDIR" ]; then
  MESSAGE="Keyring directory already exists...continuing..." ; blue_echo
else
  sudo mkdir -p /etc/apt/keyrings
fi