Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

identifying a remsh executed script

Status
Not open for further replies.

Birbone

MIS
Dec 20, 2000
141
US
Is there a way for a script to determine when it is being called via remsh?
Here's what I am trying to accomplish. I have one development and four production boxes. Each production box is divided between several different Units. When any user runs the script from a production box, it will provide the results by Unit for just that box. When ran from the development box the script uses remsh to gather and display the Unit information from all boxes. I want the script on the production boxes to perform an additional procedure only when ran remotely via remsh. How can I do this?
-Bobby s-)
bwgunn@icqmail.com
 
I must admit the I have no idea whether you can determine how your script was executed,
but IMHO you can just add another parameter to the script that (when used) will indicate
that the script is being executed remotely...
Jean Spector
QA Engineer @ mSAFE Ltd.
 
Bobby,

how about just having a copy of the script, including the extra procedure, for use by remsh ?

i realise that you may have to now support 2 scripts instead of 1 but ... KISS (keep it short and simple)

Best of Irish Luck, David.
djwilkes@hotmail.com
 
Thanks to you both for your help. Jean, I'm not sure what you mean with IMHO to add another parameter, but I got the jest.

My work around is to write a comment to a flagfile when the script is ran on the development box and then rcp it to the production boxes. Since the script empties the flagfile on that box at the end of the script, if it has any size to it then the script knows it was called remotely and performs the additional function. And once completed, it empties the flagfile.

That way the script manages the flagfile, instead of having to support an additional script. -Bobby s-)
bwgunn@icqmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top