Last active
December 13, 2022 20:59
-
-
Save gkio/d62aac437a7f23bc4c81b6ed640b2182 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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." |
Author
gkio
commented
Dec 13, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment