Setting up chroot logic

This commit is contained in:
2020-05-01 20:10:29 -05:00
parent 069ef7b55a
commit 6071fba20e
5 changed files with 45 additions and 19 deletions

View File

@@ -8,26 +8,20 @@
. CONFIG.sh
function main() {
sanity_check
if [[ $? -eq 1 ]]; then echo "\nExiting..."; return; fi
if [[ $(sanity_check) -eq 1 ]]; then echo "\nExiting..."; return; fi
# First setup the debootstrap env...
./step_1_debootstrap.sh
# Then setup and run chroot
# ./step_2_chroot.sh
./step_2_chroot.sh
}
function sanity_check() {
clear;
echo "Working Dir: " $(pwd) "\n";
# Make work structure
mkdir -p work/chroot ;
# Check for debootstrap command and then install from downloaded deb if not present.
# we could install from current apt buti want the user and myself to be fully aware
# of what they are chosing. IE, they could just run the install command themselves...
# We could install from current apt but I want the user and myself to be fully aware
# of what they are chosing. IE, we could just run the install command themselves...
debootstrap_comm=$(which debootstrap)
if [[ "${debootstrap_comm}" == "" ]]; then
echo "No deboostrap command found so will try installing from local directory...\n"