summaryrefslogtreecommitdiffstats
path: root/lexd-spool.sh
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2026-08-30 11:21:54 +0800
committerSadeep Madurange <sadeep@asciimx.com>2026-08-30 11:21:54 +0800
commit4c1da52f4a7bb71952fa2eaa06b230e9f86ea699 (patch)
tree580440684b4a91c06f81a30d52803cb5c04f6566 /lexd-spool.sh
parent75b44c80a284b793a53723c21840909ed44ba577 (diff)
downloadlex-master.tar.gz
Capture SSH command errors.HEADmaster
Diffstat (limited to 'lexd-spool.sh')
-rwxr-xr-xlexd-spool.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/lexd-spool.sh b/lexd-spool.sh
index 9ce9c3b..c0cf632 100755
--- a/lexd-spool.sh
+++ b/lexd-spool.sh
@@ -101,9 +101,15 @@ while true; do
remote_cmd="${remote_cmd} rm -f"
remote_cmd="${remote_cmd} '${SPOOL_DIR}/${SPOOL_FILE}'"
- print -r -- "${response}" \
+ ssh_err=$(print -r -- "${response}" \
| fold -s -w 72 \
- | ssh -F "${SSH_CONFIG}" "${SSH_HOST}" "${remote_cmd}"
+ | ssh -F "${SSH_CONFIG}" "${SSH_HOST}" "${remote_cmd}" 2>&1 >/dev/null)
+ ssh_res=$?
+
+ if [ ${ssh_res} -ne 0 ]; then
+ log_err "SSH error on ${SPOOL_FILE} (code ${ssh_res}): ${ssh_err}"
+ exit 1
+ fi
log_info "Finished processing: ${target_word}"
)