IBM / ibmichroot

A set of scripts to facilitate the use of chroot-based containers for IBM i
MIT License
21 stars 9 forks source link

mkdir $CHROOT_DIR if not exist #26

Closed abmusse closed 8 years ago

abmusse commented 8 years ago

Original report by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


Currently we need to issue mkdir /QOpenSys/path/to/new/chroot before running chroot_setup.sh. I propose we enhance chroot_setup.sh to create the chroot destination directory if it doesn't exist.

chroot_setup.sh (partial snippet) proposed change:

. . .
qopen=$(echo $CHROOT_DIR | grep -c '/QOpenSys')
if (($qopen==0)); then
  echo "Error: 2nd paramter must start /QOpenSys ($CHROOT_DIR)"
  opr="error"
fi
mkdir -p $CHROOT_DIR   <----------- proposed change
# run operation
# $PS1='ranger$ '
key=""
val=""
. . .

Thoughts?

abmusse commented 8 years ago

Original comment by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


Addressed in this commit.

abmusse commented 8 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


Ok by me.