mirror of
https://git.adityakumar.xyz/lfs-scripts.git
synced 2024-11-24 04:32:54 +00:00
move driver code for chapter 4 inside chapter 4 folder
This commit is contained in:
parent
811dc4fe1d
commit
dc3d878e75
2 changed files with 57 additions and 31 deletions
55
scripts/chapter4/main.sh
Normal file
55
scripts/chapter4/main.sh
Normal file
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Exit on error
|
||||
# =============
|
||||
exit_status=0
|
||||
|
||||
function check_exit_code() {
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit_status=1
|
||||
else
|
||||
exit_status=0
|
||||
fi
|
||||
}
|
||||
|
||||
function stop_script() {
|
||||
echo "Script failed in $(pwd)/$1"
|
||||
exit 1
|
||||
}
|
||||
echo "Creating directories"
|
||||
su -c "bash ./4.2-create-dir.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter4/4.2-create-dir.sh"
|
||||
fi
|
||||
|
||||
|
||||
# Chapter 4.3
|
||||
# ===========
|
||||
echo "Adding LFS user"
|
||||
su -c "bash ./4.3-add-user.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter4/4.3-add-user.sh"
|
||||
fi
|
||||
|
||||
PWD=$(pwd)
|
||||
|
||||
# Chapter 4.4
|
||||
# ===========
|
||||
echo "Setting Up the Environment"
|
||||
su - lfs -c "bash $PWD/4.4-set-up-env.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter4/4.4-set-up-env.sh"
|
||||
fi
|
|
@ -62,42 +62,13 @@ fi
|
|||
# Chapter 4
|
||||
# =========
|
||||
echo "Chapter 4"
|
||||
echo "Creating direcctories"
|
||||
su -c "bash ./chapter4/4.2-create-dir.sh"
|
||||
bash ./chapter4/main.sh
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter4/4.2-create-dir.sh"
|
||||
fi
|
||||
|
||||
|
||||
# Chapter 4.3
|
||||
# ===========
|
||||
echo "Adding LFS user"
|
||||
su -c "bash ./chapter4/4.3-add-user.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter4/4.3-add-user.sh"
|
||||
fi
|
||||
<<<<<<< HEAD
|
||||
|
||||
PWD=$(pwd)
|
||||
|
||||
# Chapter 4.4
|
||||
# ===========
|
||||
echo "Setting Up the Environment"
|
||||
su - lfs -c "bash $PWD/chapter4/4.4-set-up-env.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter4/4.4-set-up-env.sh"
|
||||
stop_script "Stopped in chapter 4"
|
||||
fi
|
||||
|
||||
# Chapter 5.2
|
||||
|
|
Loading…
Reference in a new issue