From c7b91c188d61819e5e9f0af4492542d0874aa7ae Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 2 Apr 2024 18:11:44 +0800 Subject: [PATCH] Script Refactoring --- scripts-new/bricks.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts-new/bricks.sh b/scripts-new/bricks.sh index 3ffe72ecc..a4c38995f 100644 --- a/scripts-new/bricks.sh +++ b/scripts-new/bricks.sh @@ -35,17 +35,15 @@ start_binaries() { start_tools() { # Assume tool_binaries=("ncpu" "infra") for binary in "${tool_binaries[@]}"; do - echo $binary bbbbbbbbbbbbbb local bin_full_path=$(get_tool_full_path "$binary") - # Assuming get_tool_full_path defines full path for each tool cmd=("$bin_full_path" -c "$OPENIM_OUTPUT_CONFIG") echo "Starting ${cmd[@]}" - "${cmd[@]}" + result="${cmd[@]}" ret_val=$? if [ $ret_val -eq 0 ]; then - echo "Started $bin_full_path successfully." + echo "Started $bin_full_path successfully." $result else - echo "Failed to start $bin_full_path with exit code $ret_val." + echo "Failed to start $bin_full_path with exit code $ret_val." $result return 1 fi done