Signed-off-by: Cao Xueliang caoxl78320@163.com --- sparrow/4-docker/buildall | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/sparrow/4-docker/buildall b/sparrow/4-docker/buildall index 3611158..e228153 100755 --- a/sparrow/4-docker/buildall +++ b/sparrow/4-docker/buildall @@ -58,10 +58,15 @@ do_one_run() mkdir $tmpdir/start_$container_name 2>/dev/null && ( cd "$container" - [ "$container_name" == "ssh-r" ] && { - container_id=$(docker ps -aqf name="ssh_r") - [ -n "$container_id" ] && exit - } + declare -A dic + local dic=(['ssh-r']='ssh_r' ['etcd']='etcd-server') + for item in ${!dic[@]} + do + [ "$container_name" == ${item} ] && { + container_id=$(docker ps -aqf name=${dic[${item}]}) + [ -n "$container_id" ] && exit + } + done [ -x first-run ] && ./first-run [ -x start ] && ./start [ "$container_name" == 'lkp-initrd' ] && ./run