LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   run commands inside chroots (http://www.linuxquestions.org/questions/linux-general-1/run-commands-inside-chroots-941935/)

entz 04-26-2012 04:09 PM

run commands inside chroots
 
hello ,

i'd like to run something like this

Code:

#! /bin/sh

chroot /<dir>
commands1
commands2
.
.
.
commandN

please note that command<1-N> should be executed inside the chroot jail

regards

Valery Reznic 04-27-2012 01:48 AM

Somewhere under /dir create script,
Code:

#! /bin/sh


commands1
commands2
.
.
.
commandN

And then run it as following:
Code:

chroot /dir /path/to/your/script
Note that /path/to/your/script should be without "/dir"

entz 05-13-2012 04:46 PM

hi ,

actually this solution is not satisfactory , i've already tried it btw
i'm trying to avoid running the commands in a separate script !

any other way to do that ?

cheers


All times are GMT -5. The time now is 02:09 PM.