#!/bin/bash VAR=`cat /etc/*release | grep -ie "^name" | sed "s/.*=\(.*\)/\1/"`; sudo apt -y install ssh curl openssh-server apt-transport-https ca-certificates gnupg2 software-properties-common sudo apt update if [ $VAR == '"Debian GNU/Linux"' ]; then echo -e "Debian system\n\n" OS_NAME='debian' elif [ $VAR == '"Ubuntu"' ]; then echo -e "Ubuntu system\n\n" OS_NAME='ubuntu' else echo "Something went wrong" exit 1 fi sudo curl -fsSL https://download.docker.com/linux/${OS_NAME}/gpg | sudo apt-key add - add-apt-repository -y "deb [arch=amd64] http://download.docker.com/linux/${OS_NAME} $(lsb_release -cs) stable" sudo apt -y update apt install -y docker-ce docker volume create psql docker run -d --restart unless-stopped --name psql -e POSTGRES_PASSWORD=psqlpass -p 5432:5432 -v psql:/var/lib/postgresql/data postgres echo "Setting up Postgres DB has been done successfully"