[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Environment Variables and Scipts in config/hooks



On Sun, Aug 31, 2014 at 6:11 PM, Bradley Rintoul <brintoul@sbcglobal.net> wrote:
>
>
> Anyway, my script is using live build to create a user and I would like to
> copy some files from a directory defined by an environment variable to a
> directory in the newly-created user's home directory.  I have figured I'd do
> this in a script suffixed with '.chroot' in the config/hooks directory.  The
> script I am running is run with sudo.  I use the "-E" argument in sudo to
> preserve the shell environment I have.  So what I'd like to do in my chroot
> hook script is this:
>
> cp -R $MY_DIR/files /home/<new_user>/.
>
> As it is right now, MY_DIR is undefined as an environment variable when the
> script is run.  How can I best accomplish what I'm trying to do?
>

Hi,

Populating the user directory with files is a typical use case. The
easiest way to achieve it is  by adding the files to /etc/skel. Here
is a general explanation of how to achieve this with live-build
(provided you are using the stable version):

 http://live-systems.org/manual/stable/html/live-manual.en.html#479

And a practical use in the examples section of the manual:

http://live-systems.org/manual/stable/html/live-manual.en.html#827

I hope this information suits your needs.

Have fun!!!



-- 
chals
www.chalsattack.com
chals@chalsattack.com


Reply to: