From d3ca5479fa010acdb7736acac11e01beed4bf209 Mon Sep 17 00:00:00 2001 From: Alexander Ustimenko Date: Thu, 25 Feb 2016 17:53:23 +0600 Subject: [PATCH] Really cleanup instances on start * If we have running instances we stop em * Then remove all It's a usable workaround for "no-tray" problem: when we hide by mistake running instance we just restart it. --- scripts/skype-wrapper | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/skype-wrapper b/scripts/skype-wrapper index c9b6f7c..4a5fa27 100755 --- a/scripts/skype-wrapper +++ b/scripts/skype-wrapper @@ -33,9 +33,10 @@ cleanup_stopped_skype_instances(){ image="$(${SUDO} docker inspect -f {{.Config.Image}} ${c})" if [ "${image}" == "sameersbn/skype:latest" ]; then running=$(${SUDO} docker inspect -f {{.State.Running}} ${c}) - if [ "${running}" != "true" ]; then - ${SUDO} docker rm "${c}" >/dev/null + if [ "${running}" = "true" ]; then + ${SUDO} docker stop "${c}" >/dev/null fi + ${SUDO} docker rm "${c}" >/dev/null fi done }