SUMMARY : With code (LONG) Jass Drivers / Finish scripts

From: Garrett, Matt M SITI-ITDIEEE <matt.garrett_at_shell.com>
Date: Fri Jun 20 2003 - 04:37:30 EDT
Thanks to the following for the help

Harry Hoffman
John Mitchell
Grahame Hay

Few answers
1. You should probably be using the undo functionality of jass.
   and then re-install jass Main Driver
2. Make a wrapper script that looks at all the finish scripts

While option 1 is properly the correct technical answer ,
Allowing backout and re-installs of Jass Drivers
It is not for the like's of me.

Option 2 , I have written a simple perl wrapper that lives on the server
to check the Finish directory and to create a tmp Driver file
Would have liked to make this run on the client but could not figure this bit
out
As the Driver files seem to be hardcoded in jass-execute so has to run on the
server.

I am sure my perl could be improved on but it works for me.

/jumpstart/jass/jass-execute-finish
------------------------------------------------
#!/bin/perl

# Wrapper script to run a Finish script that do not have a Driver Script
# Creates a temp Driver script in Drivers (tmpdriver)
# Wrapper checks for the Finish script
# Prints jass-execute -d temp/driver

# Matthew Garrett
# Based on a idea By Grahame Hay

# Get the finish script name from command line
my $finish = shift ;

# Work if the Finsh script exists
chdir("/jumpstart/jass/Finish");
opendir(DIR, ".");
@listing = readdir(DIR);
foreach $list (@listing) {
        stat($list);
        if ((-f _) && ($list eq $finish)) {
                # If we have got this far , Finish script exists
                # Create a tmp Driver scripts
                open(tmpdriver,">/jumpstart/jass/Drivers/tmpdriver.driver") ||
die "Can't open to write /jumpstart/jass/Drivers/tmpdriver.driver $!";
                print tmpdriver "#!/bin/sh\n";
                print tmpdriver "DIR=\"`/bin/dirname \$0`\"\n";
                print tmpdriver "export DIR\n";
                print tmpdriver ". \${DIR}/driver.init\n";
                print tmpdriver "JASS_FILES=\" \"\n";
                print tmpdriver "JASS_SCRIPTS=\"\n";
                print tmpdriver "$list\n";
                print tmpdriver "\"\n";
                print tmpdriver ". \${DIR}/driver.run\n";
                close(tmpdriver);

                # Now print out what client needs to run

                print "On client run the following command\n";
                print "/net/SERVER_HOST_NAME/jumpstart/jass/jass-execute -d
tmpdriver.driver\n";
        }
}

-----------------------------------------------------------------------------
--------


Matt

Matthew Garrett
Unix System Support
Shell Information Technology International Limited
Seafield House, North Anderson Drive, Aberdeen AB15 6GZ, United Kingdom

Tel: +44 (0)1224 81 8373 Other Tel: Internal 630 8373
Email: Matt.M.Garrett@is.shell.com
Internet: http://www.shell.com


> -----Original Message-----
> From: Garrett, Matt M SITI-ITDIEEE
> Sent: 18 June 2003 15:17
> To: Sunmanagers (E-mail)
> Subject: Jass Drivers / Finish scripts
>
>
> Folks
>
> We have been using jass (Solaris 8) for some time now.
> Very good product
>
> One small problem.
>
> Some times we need to re-run a Finish script on a client
> If some thing has gone wrong with just that bit of the client
>
> The way we have been doing it is to create a Driver file
> called test.driver
> e.g
> File = test.driver
> --------------------------------------------------------------
> ---------------
> -
> #!/bin/sh
> DIR="`/bin/dirname $0`"
> export DIR
>
> . ${DIR}/driver.init
>
> JASS_FILES="
> "
> JASS_SCRIPTS="
>                 install-WHATEVER.fin     # <- Need to change
> to what ever
> Finish script , you want to run
> "
>
> . ${DIR}/driver.run
> --------------------------------------------------------------
> ---------------
>
> On the client we then do
> /net/HOSTNAME/jass/jass-execute -d test.driver
>
>
> Is there a way to run a Finish script with out having to
> create a temporary
> driver script first ?
>
> Will summarise
>
> Thanks
>
> Matt
>
>
> Matthew Garrett
> Unix System Support
> Shell Information Technology International Limited
> Seafield House, North Anderson Drive, Aberdeen AB15 6GZ,
> United Kingdom
>
> Tel: +44 (0)1224 81 8373 Other Tel: Internal 630 8373
> Email: Matt.M.Garrett@is.shell.com
> Internet: http://www.shell.com
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Jun 20 04:40:37 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:15 EST