diff options
-rw-r--r-- | chapter7/backup.sh | 8 | ||||
-rw-r--r-- | chapter7/cleanup.sh | 6 | ||||
-rwxr-xr-x | lfs.sh | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 2aac08e..a6abb86 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -4,19 +4,19 @@ file="${LFS_VER}-ch7-backup.tar.xz" directories=(bin dev etc lib lib64 proc run sbin sys tools usr var) if [ -f "${LFS}/sources/chapter7/backup" ]; then - echo -e " ${IGRN}Backup found. Remove manually to backup again.${RST}" + printf "%b" " ${IGRN}Backup previously completed${RST}\n" else - echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " + printf "%b" "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " pushd "${LFS}" > /dev/null || exit 1 sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" >/dev/null 2>&1 & pid=$! spinner "$pid" "${SPINNER}" retval=$? if [ "${retval}" -ne 0 ]; then - echo -e "${IRED}FAILED!${RST}\n" + printf "%b" "${IRED}FAILED!${RST}\n" exit "${retval}" else - echo -e "${IGRN}OK${RST}\n" + printf "%b" "${IGRN}OK${RST}\n" fi popd > /dev/null || exit 1 diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh index 60a934f..0a5ec86 100644 --- a/chapter7/cleanup.sh +++ b/chapter7/cleanup.sh @@ -1,10 +1,10 @@ #!/bin/bash if [ -f "${LFS}/sources/chapter7/cleanup" ]; then - echo -e " ${IGRN}Cleanup already performed.${RST}" + printf "%b" " ${IGRN}Cleanup already performed${RST}\n" else - echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... " + printf "%b" "${GRN}Cleaning up ${YLW}${LFS}${RST}... " sudo find "${LFS}"/usr/lib -name \*.la -delete >/dev/null 2>&1 sudo find "${LFS}"/usr/libexec -name \*.la -delete >/dev/null 2>&1 @@ -18,6 +18,6 @@ else sudo strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1 sudo strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1 - echo -e "${IGRN}OK${RST}\n" + printf "%b" "${IGRN}OK${RST}\n" touch "${LFS}"/sources/chapter7/cleanup >/dev/null 2>&1 fi @@ -169,7 +169,8 @@ if [[ "$retval" -eq 7 ]]; then sudo umount "${LFS}"/sys sudo umount "${LFS}"/proc - printf "%b" "\n${YLW}Chapter 7 ${GRN}cleanup and backup${RST}\n" + printf "%b" "\n${IWHT}======= ${IYLW}Chapter 7 ${IGRN}Cleanup and Backup \ +${IWHT}=======${RST}\n" source "${LFS}"/sources/chapter7/cleanup.sh source "${LFS}"/sources/chapter7/backup.sh else |