only when images not exist or $action != "reboot", need to execute ./build and ./install, otherwise just execute ./first-run and ./start
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 ca4406b..6fd0ab2 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 + if [ "$?" -ne 0 ] || [ "$action" != "reboot" ]; then [ -x build ] && ./build [ -x install ] && ./install fi
On Thu, Jan 07, 2021 at 11:57:34AM +0800, Liu Yinsi wrote:
only when images not exist or $action != "reboot", need to execute ./build and ./install, otherwise just execute ./first-run and ./start
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 ca4406b..6fd0ab2 100755 --- a/sparrow/4-docker/buildall +++ b/sparrow/4-docker/buildall @@ -33,7 +33,7 @@ do_one() cd $container
Please always use "$xxx" for cd for safety reason.
cd $SCRIPT_DIR => cd "$SCRIPT_DIR"
Then it'll show error if $SCRIPT_DIR is empty, instead of silently cd into $HOME.
Thanks, Chenglong
[ "$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
-- 2.23.0
cd $SCRIPT_DIR
=> cd "$SCRIPT_DIR"
Then it'll show error if $SCRIPT_DIR is empty, instead of silently cd into $HOME.
ok, got it
Thanks, Yinsi
Thanks, Chenglong
[ "$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
-- 2.23.0