-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathnet
executable file
·38 lines (32 loc) · 869 Bytes
/
net
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
#!/bin/bash
if [ -z "$COOG_CODE_DIR" ] || [ ! -d "$COOG_CODE_DIR" ] || [ -z "$COOG_DATA_DIR" ]
then
{
echo "Please make sure that these two env vars are set:"
echo " COOG_CODE_DIR: your coog-admin install folder"
echo " COOG_DATA_DIR: the folder where to keep your custom config"
} >&2 && exit 1
fi
_create() {
docker network create "$NETWORK_NAME"
}
_rm() {
docker network rm "$NETWORK_NAME"
}
usage() {
echo
echo Available commands
echo
echo " create -> creates coog network"
echo " rm -> removes coog network"
echo
}
main() {
source "$COOG_CODE_DIR/config"
[ -z "$1" ] && usage && return 0
local cmd; cmd=$1; shift
[ "$cmd" = "create" ] && { _create "$@"; return $?; }
[ "$cmd" = "rm" ] && { _rm "$@"; return $?; }
echo "bad command" && return 1
}
main "$@"