File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,22 @@ function isReady {
108108 fi
109109 return 0
110110 else
111- if [ $( ${_client} " lna" | tail -n +6 | grep -Ev " ${_legacy_wfr_exclusions} " | wc -l | awk ' {$1=$1};1' ) != " 0" ]; then
111+ # Run client command using piped input (more reliable than command-line args)
112+ # The client with command-line args can return "Closed" even when ready
113+ local client_output
114+ client_output=$( echo " lna" | ${_client} 2>&1 )
115+ local client_exit_code=$?
116+
117+ # If client command failed, system is not ready
118+ if [ ${client_exit_code} -ne 0 ]; then
119+ return 1
120+ fi
121+
122+ # Check if there are any bundles not active (excluding known exclusions)
123+ # First grep for actual bundle rows with "Resolved" state, then exclude known fragments
124+ local resolved_bundles
125+ resolved_bundles=$( echo " ${client_output} " | grep " │ Resolved │" | grep -Ev " ${_legacy_wfr_exclusions} " | wc -l | awk ' {$1=$1};1' )
126+ if [ " ${resolved_bundles} " != " 0" ]; then
112127 return 1
113128 fi
114129 return 0
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ echo -e "\nLog file found, continuing..."
1313waitForReady
1414
1515if [ -n " $INSTALL_PROFILE " ]; then
16- echo " Installing $INSTALL_PROFILE profile. This may take some time..."
17- ${_client} profile:install ${INSTALL_PROFILE}
16+ echo " Installing $INSTALL_PROFILE profile. This may take some time..."
17+ echo " profile:install ${INSTALL_PROFILE} " | ${_client }
1818 waitForReady
1919fi
2020
@@ -24,7 +24,7 @@ if [ -n "$INSTALL_FEATURES" ]; then
2424 for index in " ${! _install_features[@]} "
2525 do
2626 echo " Installing: ${_install_features[$index]} "
27- ${_client} " feature:install ${_install_features[$index]} "
27+ echo " feature:install ${_install_features[$index]} " | ${_client}
2828 done
2929fi
3030
@@ -34,7 +34,7 @@ if [ -n "$UNINSTALL_FEATURES" ]; then
3434 for index in " ${! _uninstall_features[@]} "
3535 do
3636 echo " Uninstalling: ${_uninstall_features[$index]} "
37- ${_client} " feature:uninstall ${_uninstall_features[$index]} "
37+ echo " feature:uninstall ${_uninstall_features[$index]} " | ${_client}
3838 done
3939fi
4040
You can’t perform that action at this time.
0 commit comments