Display return status on bastille cp batch/loop

This commit is contained in:
Jose
2020-07-31 08:51:47 -04:00
parent 709f00a2ac
commit a0b0eadc68

View File

@@ -61,11 +61,13 @@ fi
for _jail in ${JAILS}; do for _jail in ${JAILS}; do
bastille_jail_path="$(jls -j "${_jail}" path)" bastille_jail_path="$(jls -j "${_jail}" path)"
echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}"
# Add line break and return status cp -av "${CPSOURCE}" "${bastille_jail_path}/${CPDEST}"
if cp -av "${CPSOURCE}" "${bastille_jail_path}/${CPDEST}"; then RETURN="$?"
echo if [ "${TARGET}" = "ALL" ]; then
# Display the return status for reference
echo -e "Returned: ${RETURN}\n"
else else
echo echo
false return "${RETURN}"
fi fi
done done