aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-03-23 18:55:35 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-03-23 18:55:35 -0500
commit85974cc684f10113f0b4ba50ac17240da751a219 (patch)
tree59ee804d98881ea6666471e9e88b80d509799988
parent60a45f6b4b1b11498fd877f4b03daba33e5de15d (diff)
parentd8da825dee0d7b5c9c8e159dfe5ea810b654c12a (diff)
Merge branch 'master' into chapter7
-rw-r--r--chapter6/backup.sh5
-rw-r--r--chapter6/cleanup.sh2
2 files changed, 4 insertions, 3 deletions
diff --git a/chapter6/backup.sh b/chapter6/backup.sh
index 0cbd314..6ffe768 100644
--- a/chapter6/backup.sh
+++ b/chapter6/backup.sh
@@ -1,7 +1,7 @@
#!/bin/bash
FILE="${LFS_VER}-ch6-backup.tar.xz"
-DIRS="bin etc lib lib64 sbin tools usr var"
+DIRS=(bin etc lib lib64 sbin tools usr var)
if [ -f "${LFS}/sources/chapter6/backup" ]; then
echo -e "${GRN}Backup found. Remove manually to backup again.${RST}"
@@ -9,11 +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}" "${DIRS}" & pid=$!
+ sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${FILE}" "${DIRS[@]}" & pid=$!
spinner "$pid"
retval=$?
if [ "$retval" -ne 0 ]; then
echo -e "${RED}Backup FAILED!${RST}"
+ exit 1
else
sudo chown "${USER}" /home/"${USER}"/"${FILE}"
echo -e "${GRN}OK${RST}"
diff --git a/chapter6/cleanup.sh b/chapter6/cleanup.sh
index 8d31264..cd620d3 100644
--- a/chapter6/cleanup.sh
+++ b/chapter6/cleanup.sh
@@ -13,7 +13,7 @@ else
rm -rf "${LFS}"/usr/share/info >/dev/null 2>&1
rm -rf "${LFS}"/usr/share/man >/dev/null 2>&1
- strip --strip-debug "${LFS}"S/usr/lib/* >/dev/null 2>&1
+ strip --strip-debug "${LFS}"/usr/lib/* >/dev/null 2>&1
strip --strip-unneeded "${LFS}"/usr/bin/* >/dev/null 2>&1
strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1
strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1