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
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