How to transfer variable from one section to another

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

 



Hi

I'm pulling my hear out here.

Thanks to your help, I managed to read a variable from the command
line and can use it in the %pre section. Write it to
/tmp/networkconfig and include it in the network section.
Unfortunately, in the %post section it gets lost.

In the post section I want to call a batch and past variables:
/tmp/esx-install.sh ${var1}

But by that time ${var1} is lost. So I tried to first create a new
file in the %pre section:

cat << EOF1 >> /call-script.sh
/tmp/esx-install.sh 10.0.0.${ESXIP} 10.0.2.${ESXIP}
EOF1
chmod a+x /call-script.sh

Which indeed did write the file call-script.sh and it contained:
/tmp/esx-install.sh 10.0.0.49 10.0.2.49

Lookin' good. Unfortunately, when running the %post section, the
script /call-script.sh can't be found. Probably because after the %pre
section the whole file system is reloaded after formatting the disk.
Which is logical I think.

Is there a place I could put this script, so I can find it in the post
section? Or should I do this in an other way?

Gabrie


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux