[Users] vztcl runscript and keep the same env variables?

2011-09-25 Thread Benjamin Henrion
Hi,

In a simple bash script named test.sh, I used to call another shell
script part1.sh keeping the same Env variables like this:

$head -n 1 test.sh
. ./part1.sh

Now, I would like to do the same with vzctl runscript:

$head -n 1 test.sh
vzctl runscript 1110 part1.sh

How do I do that?

Best,

--
Benjamin Henrion bhenrion at ffii.org
FFII Brussels - +32-484-566109 - +32-2-4148403
In July 2005, after several failed attempts to legalise software
patents in Europe, the patent establishment changed its strategy.
Instead of explicitly seeking to sanction the patentability of
software, they are now seeking to create a central European patent
court, which would establish and enforce patentability rules in their
favor, without any possibility of correction by competing courts or
democratically elected legislators.
___
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users


Re: [Users] vztcl runscript and keep the same env variables?

2011-09-25 Thread Sam Trenholme
 In a simple bash script named test.sh, I used to call another shell
 script part1.sh keeping the same Env variables like this:

 $head -n 1 test.sh
 . ./part1.sh

 Now, I would like to do the same with vzctl runscript:

 $head -n 1 test.sh
 vzctl runscript 1110 part1.sh

echo '#!/bin/bash'  tmp.sh
env | awk -F= '{print $1 =\ $2 \}'  tmp.sh
cat part1.sh  tmp.sh
vzctl runscript 1110 tmp.sh
rm tmp.sh

Escaping quotes in environmental variables or using mktemp is left as
an exercise to the reader.

- Sam
___
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users


Re: [Users] vztcl runscript and keep the same env variables?

2011-09-25 Thread Sam Trenholme
 env | awk -F= '{print export  $1 =\ $2 \}'  tmp.sh

Works even better :)
___
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users