Don't fail if CONTAINER is inexistant.

This commit is contained in:
Paul Lietar committed 2013-11-22 22:58:02 +00:00
1 parent e42c028d18
commit 8a9182c859
3 files changed
+15 -10

No files matched your search

+14 -7
View File
@@ -13,11 +13,14 @@ case "$1" in
fi
pluginhook pre-delete $APP
ID=$(< "$DOKKU_ROOT/$APP/CONTAINER")
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
ID=$(< "$DOKKU_ROOT/$APP/CONTAINER")
docker stop $ID > /dev/null
docker rm $ID > /dev/null
fi
docker stop $ID > /dev/null
docker images | grep $IMAGE | awk '{print $3}' | xargs docker rmi &> /dev/null &
docker rm $ID > /dev/null
pluginhook post-delete $APP
;;
@@ -33,10 +36,14 @@ case "$1" in
exit 1
fi
CONTAINER=$(<$DOKKU_ROOT/$APP/CONTAINER)
docker logs $CONTAINER | tail -n 100
if [[ $3 == "-t" ]]; then
docker attach $CONTAINER
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
CONTAINER=$(<$DOKKU_ROOT/$APP/CONTAINER)
docker logs $CONTAINER | tail -n 100
if [[ $3 == "-t" ]]; then
docker attach $CONTAINER
fi
else
echo "Application's container not found"
fi
;;