Hi Sun-managers:
Although I got many responses (most of which stated trying this syntax ${area} -
which I already tried to no avail), special thanks goes to:
Gary Franczyk
Jim Earnest
for pointing me in the right direction. I did the following in my script:
SOLUTION:
rsh $target "echo area=$area > /tmp/area"
rdist -d target=root@$target -d file=$file -d area=$area -f distfile
In this way, I could source /tmp/area as part of the special command. Here is
the resulting distfile:
HOSTS = ( ${target} )
FILES = ( ${file} )
(${FILES}) -> (${HOSTS})
install /jumpstart/${area}/Config/etc/rc3.d/${file} ;
special ". /tmp/area; /jumpstart/create_config_file.sh $area; rm /tmp/ar
ea" ;
notify blained@gdls.com ;
RESPONSES:
May want to try the special command as follows,
special "/jumpstart/create_config_file.sh $"{area}" ;
Otherwise you can have your wrapper script write the area variable to a file
in /tmp and
then use rdist to distribute this file over to the remote system and then
modify /jumpstart/create_config_file.sh to read $area from the file in
/tmp.
Or something along these lines..
Hope this helps
Jim Earnest
jearnest@lasmx.tinker.af.mil
----------------------------
How about this... The environment that rdist has is the same as you would
have in an "rsh" command... Therefore, if you have your script add this line
to your /.cshrc file:
setenv AREA "this is the area"
and then rdist'ed the /.cshrc file BEFORE you rdist'ed the other file(s),
the environment variable $AREA would be set when the special command was
run.
(This may be a rube-goldberg machine, but it should work)
* gary franczyk
* systems administrator / dba
* 512.435.3286
-----------------------------
My original question follows. Thanks again
------------------
David Blaine (blained@gdls.com)
Computer Systems Engineer
CSC for GDLS
Phone: 810-825-7650
------------- Begin Forwarded Message -------------
Date: Thu, 15 Apr 1999 08:42:20 -0400 (EDT)
From: "David W. Blaine" <blained@gdls.com>
Subject: rdist's special command
To: sun-managers@sunmanagers.ececs.uc.edu
MIME-Version: 1.0
Content-MD5: Sjl7hLWzjyt7Em0HrbTnMg==
Hi Sun-managers
I am trying to setup a centralized management server for several jumpstart
servers I administer. To do this, I centralized some of my key configuration
files and use rdist to update the servers. However, I have a need to run a
command after the update via rdist's special command with a parameter. I have a
script which asks me for a variable called "area" defined then called rdist with
the following:
rdist -d target=root@$target -d file=$file -d area=$area -f distfile
in the distfile, I want to use it like this:
HOSTS = ( ${target} )
FILES = ( ${file} )
(${FILES}) -> (${HOSTS})
install /jumpstart/${area}/Config/etc/rc3.d/${file} ;
special "/jumpstart/create_config_file.sh $area" ;
notify blained@gdls.com ;
The install command properly substitutes the "area" variable and installs the
file as expected, but the special command does not. Any ideas? Or is this a
limitation of rdist?
------------------
David Blaine (blained@gdls.com)
Computer Systems Engineer
CSC for GDLS
Phone: 810-825-7650
------------- End Forwarded Message -------------
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:18 CDT