From a0b0eadc684acc2ba59866e245fe0b3ca00ce7d5 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 31 Jul 2020 08:51:47 -0400 Subject: [PATCH] Display return status on bastille cp batch/loop --- usr/local/share/bastille/cp.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index ad2faaa2..83dbf0b8 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -61,11 +61,13 @@ fi for _jail in ${JAILS}; do bastille_jail_path="$(jls -j "${_jail}" path)" echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" - # Add line break and return status - if cp -av "${CPSOURCE}" "${bastille_jail_path}/${CPDEST}"; then - echo + cp -av "${CPSOURCE}" "${bastille_jail_path}/${CPDEST}" + RETURN="$?" + if [ "${TARGET}" = "ALL" ]; then + # Display the return status for reference + echo -e "Returned: ${RETURN}\n" else echo - false + return "${RETURN}" fi done