mirror of
https://github.com/scratchfoundation/scratch-docker.git
synced 2025-07-03 21:40:19 -04:00
Make docker_config.sh a little smarter about usage
This commit is contained in:
parent
9bc3fa9ef8
commit
cb4e4832a1
1 changed files with 20 additions and 3 deletions
|
@ -1,5 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
NETWORK_NAME=scratchapi_scratch_network
|
NETWORK_NAME=scratchapi_scratch_network
|
||||||
|
|
||||||
if [ -z $(docker network ls --filter name=^${NETWORK_NAME}$ --format="{{ .Name }}") ] ; then
|
command=$1
|
||||||
docker network create ${NETWORK_NAME} ;
|
shift
|
||||||
fi
|
arg=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
case "$command" in
|
||||||
|
network)
|
||||||
|
if [ -z $(docker network ls --filter name=^${NETWORK_NAME}$ --format="{{ .Name }}") ] ; then
|
||||||
|
docker network create ${NETWORK_NAME} ;
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "usage:"
|
||||||
|
echo " docker_config.sh <command> <arg>"
|
||||||
|
echo ""
|
||||||
|
echo " Currently only performs 'docker_config.sh network create'"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue