I need to check in a shell script if Docker is installed (Ubuntu server).
I came up with this, but the syntax is not correct.
if [[ which docker && docker --version ]]; then
echo "Update docker"
# command
else
echo "Install docker"
# command
fi
I also tried if [ which docker ] && [ docker --version ]; then