From 6df3121c554f485fc747feb0f348b50e08c3680f Mon Sep 17 00:00:00 2001
From: William Harrington <kb0iic@berzerkula.org>
Date: Fri, 26 Mar 2021 17:16:46 -0500
Subject: Remove unset command at end and direct all output to /dev/null for
 tar.

---
 chapter6/backup.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'chapter6')

diff --git a/chapter6/backup.sh b/chapter6/backup.sh
index 7c458c8..e25b3e4 100644
--- a/chapter6/backup.sh
+++ b/chapter6/backup.sh
@@ -9,12 +9,12 @@ else
 
 	echo -ne "${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[@]}" & pid=$!
+		sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" >/dev/null 2>&1 & pid=$!
 		spinner "$pid"
 		retval=$?
 		if [ "$retval" -ne 0 ]; then
 			printf "%b" "${RED}FAILED!${RST}\n"
-			exit 1
+			exit "${retval}"
 		else
 			sudo chown "${USER}" "${HOME}"/"${file}"
 			printf "%b" "${GRN}OK${RST}\n"
@@ -23,5 +23,3 @@ else
 
 	touch "${LFS}/sources/chapter6/backup"
 fi
-
-unset file directories
-- 
cgit v1.2.3-54-g00ecf