1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-21 15:54:22 +01:00

revert if cmd to using 0

This commit is contained in:
Sylvain 2019-10-22 11:25:34 +02:00
parent 719bb31968
commit 5fb1ad781b

View File

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