On Wed, Jan 13, 2021 at 03:27:50PM +0800, Liu Yinsi wrote:
before: if execute ./buildall and docker images exist, then ./build after: if execute ./buildall or docker images not exist, then ./build
Signed-off-by: Liu Yinsi liuyinsi@163.com
sparrow/4-docker/buildall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sparrow/4-docker/buildall b/sparrow/4-docker/buildall index f24226c..77fe43a 100755 --- a/sparrow/4-docker/buildall +++ b/sparrow/4-docker/buildall @@ -33,7 +33,7 @@ do_one() cd "$container" [ "$container_name" == 'ssh-r' ] && exit
docker images | grep -wq "$container_name"
if [ "$?" == 0 ] && [ "$action" != "reboot" ]; then
fiif [ "$?" -ne 0 ] || [ "$action" != "reboot" ]; then [ -x build ] && ./build [ -x install ] && ./install
it looks too difficult to understand. how about the follow:
docker images | grep -wq "$container_name" || { [ "$action" == "reboot" ] || { [ -x build ] && ./build [ -x install ] && ./install } }
-------- Thanks Yu Chuan
-- 2.23.0