Skip to content

Instantly share code, notes, and snippets.

@gkio
Last active December 13, 2022 20:59
Show Gist options
  • Save gkio/d62aac437a7f23bc4c81b6ed640b2182 to your computer and use it in GitHub Desktop.
Save gkio/d62aac437a7f23bc4c81b6ed640b2182 to your computer and use it in GitHub Desktop.
#!/bin/bash
function error {
echo -e "\\e[91m$1\\e[39m"
exit 1
}
function check_internet() {
printf "Checking if you are online..."
wget -q --spider http://github.com
if [ $? -eq 0 ]; then
echo "Online. Continuing."
else
error "Offline. Go connect to the internet then run the script again."
fi
}
check_internet
curl -sSL https://get.docker.com | sh || error "Failed to install Docker."
sudo usermod -aG docker $USER || error "Failed to add user to the Docker usergroup."
echo "Remember to logoff/reboot for the changes to take effect."
@gkio
Copy link
Author

gkio commented Dec 13, 2022

wget -qO- https://gist.githubusercontent.com/gkio/d62aac437a7f23bc4c81b6ed640b2182/raw/a106b33ff08965b032daafa0ebd6b0b766fff36e/docker-install.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment