#!/bin/bash


# FUNCTIONS
function purge_ceph {
  container_count=$(docker ps -q | wc -l)

  if [[ "${container_count}" -gt 0 ]]; then
    docker stop $(docker ps -q) || echo failed to stop containers
  fi

  rm -rf /var/lib/ceph/*
  rm -rf /etc/ceph
}


# MAIN
purge_ceph

#!/bin/bash


# FUNCTIONS
function purge_ceph {
  containers_to_stop=$(docker ps -q)

  if [ "${containers_to_stop}" ]; then
    docker stop ${containers_to_stop} || echo failed to stop containers
  fi

  rm -rf /var/lib/ceph/*
  rm -rf /etc/ceph
}


# MAIN
purge_ceph

Update purge cluster script for travis builds
Update purge cluster script for travis builds

- Only run container status command once

Signed-off-by: Ivan Font <d5ef2290306f77a0aabb2bb89953a654042acd12@redhat.com>
