1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

fix bash: if cmd

This commit is contained in:
Sylvain 2019-10-22 10:54:48 +02:00
parent cbd93ca7d8
commit cc74b42a2b

View File

@ -77,7 +77,7 @@ test_docker_compose()
{
if [[ -f "$FM_PATH/docker-compose.yml" ]]
then
if [[ $(docker-compose ps | grep postgres) = 0 ]]
if docker-compose ps | grep postgres
then
TYPE="DOCKER-COMPOSE"
local container_id, ip
@ -121,7 +121,7 @@ ensure_pg_down()
{
if [ -f "$PG_PATH/postmaster.pid" ]; then
echo 'ERROR: lock file "postmaster.pid" exists'
if [[ $(docker-compose ps | grep postgres) = 1 ]]; then
if ! docker-compose ps | grep postgres; then
read -rp 'docker-compose container is not running. Confirm delete the lock file? (y/N) ' confirm </dev/tty
if [ "$confirm" = "y" ]; then
if [ "$(whoami)" = "root" ]; then COMMAND="rm"