From 8b5530be21a8e28e3e2c1b9917ca3645fbd13398 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 15 Apr 2021 08:32:23 -0500 Subject: Create fail and success functions and remove trailing white spaces at ends of lines. --- chapter7/backup.sh | 4 ++-- chapter7/cleanup.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 9418775..b903897 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -15,12 +15,12 @@ else spinner "$pid" "${SPINNER}" retval=$? if [ "${retval}" -ne 0 ]; then - printf "%b" "${IRED}FAILED!${RST}\n" + fail "FAILED!" exit "${retval}" else # shellcheck disable=SC2024 sudo chown -v "${USER}":"$(id -g)" "${HOME}"/"${file}" >"${LFS}"/sources/log/chapter7/backup.log 2>&1 - printf "%b" "${IGRN}OK${RST}\n" + success "OK" fi popd > /dev/null || exit 1 diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh index 53ad4d4..3e4dfa3 100644 --- a/chapter7/cleanup.sh +++ b/chapter7/cleanup.sh @@ -21,6 +21,6 @@ else sudo strip --strip-unneeded "${LFS}"/tools/bin/* || true } >"${LFS}"/sources/log/chapter7/cleanup.log 2>&1 - printf "%b" "${IGRN}OK${RST}\n" + success "OK" sudo touch "${LFS}"/sources/chapter7/cleanup >/dev/null 2>&1 fi -- cgit v1.2.3-54-g00ecf