-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsmatch.sh
executable file
·47 lines (41 loc) · 1008 Bytes
/
vsmatch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
port=9000
function usage {
echo "VisualSMATCH starter"
echo
echo "usage: $0 [--port PORT] [--] [docker run options...]"
echo
echo "--port PORT change port to listen on (default: $port)"
echo
echo "Requires docker: https://www.docker.com/"
echo
}
for arg in $@; do
if [ "$arg" == "--help" ] || [ "$arg" == "-h" ]; then
usage
exit 0
fi
done
while [ $# -gt 0 ]; do
if [ "$1" == "--" ]; then
shift
break
elif [ "$1" == "--port" ] || [ "$1" == "-p" ]; then
shift
port="$1"
shift
else
echo "unknown argument: $1"
exit 1
fi
done
if [ "$DOCKER_MACHINE_NAME" != "" ] && [ "`which docker-machine`" != "" ]; then
echo
echo "VisualSMATCH will be available at address http://`docker-machine ip $DOCKER_MACHINE_NAME`:$port"
echo
else
echo
echo "VisualSMATCH will be available at address http://localhost:$port"
echo
fi
docker run -it -p $port:9000 $@ didzis/visualsmatch