csession script which working with docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NAME=$1 | |
CONTAINER=`docker container ls -q -f "name=$NAME"` | |
if [ -z $CONTAINER ] | |
then | |
echo "Docker container with name $NAME not found" | |
exit 1 | |
fi | |
INSTANCE=`docker container inspect $CONTAINER -f '{{range .Config.Env }}{{println .}}{{end}}' | grep 'ISC_PACKAGE_INSTANCENAME' | cut -d'=' -f2` | |
echo "Container $CONTAINER" | |
echo "Instance $INSTANCE" | |
if [ -z $INSTANCE ] | |
then | |
echo "Cache instance in container with name $NAME not found" | |
exit 1 | |
fi | |
docker exec -it $CONTAINER csession $INSTANCE ${@:2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment