aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-02 13:36:51 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-02 13:36:51 -0500
commitd15a78517dfa18948aaf9ae91b19cdc2de5df998 (patch)
tree01cbf0cc8c2db4e5a4e7ad69ee057e5c00a0b6c5
parent89ca137a22258537e9fd7e973a037fd0c50749bc (diff)
Cleanup information messages for chapater 7 backup and cleanup and change from echo to printf.
-rw-r--r--chapter7/backup.sh8
-rw-r--r--chapter7/cleanup.sh6
-rwxr-xr-xlfs.sh3
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
diff --git a/lfs.sh b/lfs.sh
index bdd8659..55bdfb6 100755
--- a/lfs.sh
+++ b/lfs.sh
@@ -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