File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,29 @@ OPTIONS:
59
59
-h, --help Display this help and exit.
60
60
-t, --tag <version> Specify which version of a docker image to pull.
61
61
-l, --local Use local docker image.
62
+ stop Stop all running Apollo containers.
62
63
EOF
63
64
exit 0
64
65
}
65
66
67
+ function stop_containers()
68
+ {
69
+ running_containers=$( docker ps --format " {{.Names}}" )
70
+
71
+ for i in ${running_containers[*]}
72
+ do
73
+ if [[ " $i " =~ apollo_* ]]; then
74
+ printf %-* s 70 " stopping container: $i ..."
75
+ docker stop $i > /dev/null
76
+ if [ $? -eq 0 ]; then
77
+ printf " \033[32m[DONE]\033[0m\n"
78
+ else
79
+ printf " \033[31m[FAILED]\033[0m\n"
80
+ fi
81
+ fi
82
+ done
83
+ }
84
+
66
85
APOLLO_ROOT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /../.." && pwd ) "
67
86
68
87
if [ ! -e /apollo ]; then
118
137
shift
119
138
source ${APOLLO_ROOT_DIR} /docker/scripts/restart_map_volume.sh \
120
139
" ${map_name} " " ${VOLUME_VERSION} "
121
- ;;
140
+ ;;
141
+ stop)
142
+ stop_containers
143
+ exit 0
144
+ ;;
122
145
* )
123
146
echo -e " \033[93mWarning\033[0m: Unknown option: $1 "
124
147
exit 2
You can’t perform that action at this time.
0 commit comments