diff --git a/install_iomatex_edge.sh b/install_iomatex_edge.sh index 5311c8a..daa285e 100755 --- a/install_iomatex_edge.sh +++ b/install_iomatex_edge.sh @@ -63,14 +63,19 @@ run_step() { "$@" ) >>"$LOG_FILE" 2>&1 & local pid=$! + local rc=0 - if spinner "$pid" "$msg"; then + spinner "$pid" "$msg" + rc=$? + + if [[ "$rc" -eq 0 ]]; then log "OK: ${msg}" return 0 fi - local rc=$? log "ERROR: ${msg} failed with rc=${rc}" + log "Last log lines for ${msg}:" + tail -n 20 "$LOG_FILE" || true return "$rc" } diff --git a/install_iomatex_z2m.sh b/install_iomatex_z2m.sh index b06b01d..04122a5 100755 --- a/install_iomatex_z2m.sh +++ b/install_iomatex_z2m.sh @@ -60,14 +60,19 @@ run_step() { "$@" ) >>"$LOG_FILE" 2>&1 & local pid=$! + local rc=0 - if spinner "$pid" "$msg"; then + spinner "$pid" "$msg" + rc=$? + + if [[ "$rc" -eq 0 ]]; then log "OK: ${msg}" return 0 fi - local rc=$? log "ERROR: ${msg} failed with rc=${rc}" + log "Last log lines for ${msg}:" + tail -n 20 "$LOG_FILE" || true return "$rc" }