Operating System - HP-UX
1833476 Members
3015 Online
110052 Solutions
New Discussion

Re: swinstall script problem

 
SOLVED
Go to solution
Peter Lachnitt
Advisor

swinstall script problem

Hello,

I want to install sw or patches non interactive from a depotserver per script.
But it dont't work can anybody help me ??

I get the Message: The interactive UI was invoked, since no software was specified.

#!/bin/ksh -xv

set depotpath = ( \
10.xxx.x.xxx:/var/spool/sw/hpux11_800/SSH \*)
#
set selist = ( 05712 )

foreach sevar ( ${selist} )
echo hp${sevar}
ping hp${sevar} 200 -n 2 > /dev/null
if ($status != 0) then
echo ABBRUCH hp${sevar}
else
foreach depotvar ( ${depotpath} )
remsh hp${sevar} /usr/sbin/swinstall \
-x autoreboot=false \
-x mount_all_filesystems=false \
-s ${depotvar}
end
endif
end
-----------------------

If I try on a Client, it works fine:
swinstall -s 10.xxx.x.xxx:/var/spool/sw/hpux11_800/SSH \*
Peter Lachnitt
3 REPLIES 3
Eknath
Trusted Contributor

Re: swinstall script problem

Hi peter,

Following is the abstract of man swinstall:
Install all the software from local depot /tmp/sample.depot.1, using
any response files generated by request scripts:

#swinstall -s /tmp/sample.depot.1 -x ask=true \*

Try this, for more information refer man pages of swinstall.

Cheers!!!
eknath
Amit Agarwal_1
Trusted Contributor

Re: swinstall script problem

Hi Peter,

If you don't want interactive session, then you need to specify
'-x patch_match_target=true'
as one of swinstall option.

-Amit
Bill Hassell
Honored Contributor
Solution

Re: swinstall script problem

I think you;ve mixed up csh commands with ksh. foreach is a C shell construct. It is particularly difficult to run multiple shells. Because csh is so incompatilbe with POSIX shells such as ksh, bash and HP's sh, it is recommended to do all sysadmin work in a POSIX shell, preferably /usr/bin/sh which is HP's POSIX shell. And in ALL cases, place the interpreter name as line number 1:

#!/usr/bin/sh

for all shell scripts.

The example that works on the client is nothing like the remsh version. On the client, use the command you're trying to run with remsh:

/usr/sbin/swinstall -x autoreboot=false -x mount_all_filesystems=false -s /your_depot_fullpath

and you'll see that it fails. swinstall requires that you specify exactly what parts of the depot you want to load--there is no default, so in the manual command, you supplied this value: \* where the star says load all. So you must add the \* to remsh, BUT with the star, you now have a shell special character, so enclose the entire remsh string in quotes:

remsh hp${sevar} "/usr/sbin/swinstall -x autoreboot=false -x mount_all_filesystems=false -s /your_depot_fullpath \*"

And finally, you can trace the steps of your script with the -x option. Just insert this the interpreter line:

set -x


Bill Hassell, sysadmin