@ -74,8 +74,9 @@ then
exit
exit
else
else
#check if docker UP
dockerserverdown = $( docker info --format "{{json .}}" | jq .ServerErrors)
dockerserverdown = $( docker info --format "{{json .}}" | jq .ServerErrors)
if [ [ $dockerversion = = *"permission denied" * ] ] ; then
if [ [ $dockerversion = ~ *"permission denied" * ] ] ; then
echo ""
echo ""
echo "docker server is down"
echo "docker server is down"
echo ""
echo ""
@ -94,21 +95,37 @@ else
exit
exit
fi
fi
#check docker version
dockerversion = $( docker info --format "{{json .}}" | jq .ServerVersion | cut -d'.' -f1)
dockerversion = $( docker info --format "{{json .}}" | jq .ServerVersion | cut -d'.' -f1)
dockerversion = " ${ dockerversion # \" } "
if [ ! -z $dockerversion ] ; then
if [ $dockerversion -lt 19 ] ; then
dockerversion = " ${ dockerversion # \" } "
if [ $dockerversion -lt 19 ] ; then
echo ""
echo "docker version < 19"
echo ""
echo "Update docker and try again!"
echo "http://docs.swarmlab.io/SwarmLab-HowTos/labs/Howtos/docker/install.adoc.html"
echo ""
echo "-----------USING UBUNTU------------"
echo "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -"
echo " sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $( lsb_release -cs) stable\" "
echo "sudo apt update"
echo "sudo apt install -y docker-ce"
echo "sudo usermod -aG docker [USERNAME]"
echo ""
toolsok = 'no'
exit
fi
else
echo ""
echo ""
echo "docker version < 19"
echo "-----------USING UBUNTU------------ "
echo ""
echo ""
echo "Update docker and try again!"
echo "Using the following commands you can enable and run docker server" ;
echo "http://docs.swarmlab.io/SwarmLab-HowTos/labs/Howtos/docker/install.adoc.html"
echo "sudo systemctl enable docker"
echo "sudo systemctl start docker"
echo "sudo systemctl status docker"
echo ""
echo ""
echo "-----------USING UBUNTU------------"
echo "After adding to the group (usermod command) your shell needs to be restarted. If you dont know what this means please just logout and log in again." ;
echo "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -"
echo " sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $( lsb_release -cs) stable\" "
echo "sudo apt update"
echo "sudo apt install -y docker-ce"
echo "sudo usermod -aG docker [USERNAME]"
echo ""
echo ""
toolsok = 'no'
toolsok = 'no'
exit
exit