03-24-2012 05:41 AM
Hello
I wonder if I can call upon your skills again.
I'm installing SF v.6 onto a Linux Platform, and trying to script an automated install onto multiple servers, without much luck.
I have created a basic reponse file using the installsf -makeresponsefile command, which I have tried to edit to call the hostname variable (short name)
As below:
# Configuration Values:
#
MYHOST="`/bin/hostname -s`"
our %CFG;
$CFG{opt}{configure}=1;
$CFG{opt}{prodmode}="SF Enterprise";
$CFG{opt}{vxkeyless}=1;
$CFG{prod}="SF60";
$CFG{systems}=[ qw(${MYHOST}) ];
But all I seem to get is an error, syntax error at /var/tmp/test.response line 5, near "our "
Has anyone created a working file that can call a short hostname within this file?
Many thanks in advance.
S Parmar
Solved! Go to Solution.
03-27-2012 03:17 AM
The response file is perl so you MAY be able to use perl syntax, but I have automated install using responsefiles and just used sed. Just save generated responsefile to "responsefile.template" just changing hostname to "%MYHOST%" so line in responsefile reads:
$CFG{systems}=[ qw(%MYHOST%) ];
and then run script
MYHOST=`/bin/hostname -s`
sed -e s/%MYHOST%/$MYHOST/ responsefile.template > ${MYHOST}.resp
and then call installer with responsefile ${MYHOST}.resp.
I used this method changing a whole load of variables to configure VCS so expanded sed statement to have a lot of "-e" flags so something like:
sed -e s/%MYHOST%/$MYHOST/ -e s/%MYVAR2%/$MYVAR2/ responsefile.template > ${MYHOST}.resp
Mike
03-24-2012 05:38 PM
03-25-2012 12:12 AM
Hi Yasuhisa
Thanks for the reply.
The idea of making the install/configure automated means that I need to insert the hostname (short) into this response file, there will be thousands of server that this will be run on, so if anyone knows of a way they have used to do this, that would really be a help.
Thanks
03-25-2012 02:50 AM
03-27-2012 02:51 AM
Nice Idea, however, never tried like this and not sure, if it will work. From general scripting perspective, try the following :
MYHOST=`/bin/hostname -s`;
our %CFG;
> Remove the quotes (it work even with the quotes on the command line, though. But can't say how the parent script (that calls this faile) treats those quotes)
> End the line with ";"
03-27-2012 03:17 AM
The response file is perl so you MAY be able to use perl syntax, but I have automated install using responsefiles and just used sed. Just save generated responsefile to "responsefile.template" just changing hostname to "%MYHOST%" so line in responsefile reads:
$CFG{systems}=[ qw(%MYHOST%) ];
and then run script
MYHOST=`/bin/hostname -s`
sed -e s/%MYHOST%/$MYHOST/ responsefile.template > ${MYHOST}.resp
and then call installer with responsefile ${MYHOST}.resp.
I used this method changing a whole load of variables to configure VCS so expanded sed statement to have a lot of "-e" flags so something like:
sed -e s/%MYHOST%/$MYHOST/ -e s/%MYVAR2%/$MYVAR2/ responsefile.template > ${MYHOST}.resp
Mike
03-27-2012 12:58 PM
Many thanks to all for the input, I tried the last post and it worked a treat.
Thanks again.
Sparmar