You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
772 B

#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo 'no service'
exit 1
fi
if [[ -z "$1" ]] ; then
echo 'no service'
exit 1
fi
service=$1
serviceeditororig=${service//_}
serviceeditororig=${service//-}
docker ps --format '{{.Names}}' | {
while read i; do
var=$i
# remove leading whitespace characters
var="${var#"${var%%[![:space:]]*}"}"
# remove trailing whitespace characters
var="${var%"${var##*[![:space:]]}"}"
serviceeditor=${var//_}
serviceeditor=${serviceeditor//-}
if [ "edit${serviceeditororig}masterservice1" == "$serviceeditor" ]; then
echo "stop sidecar instance ${serviceeditor} ";
docker stop edit_${serviceeditororig}masterservice1
docker container rm edit_${serviceeditororig}masterservice1
fi
done
}