home *** CD-ROM | disk | FTP | other *** search
- #!/p/sy/subsys/scripts/wermit +
- #!/p/kd/fdc/solaris9/wermit +
- #!/p/kd/fdc/RHEL4/wermit +
- #
- # IMPORTANT: The first line must indicate the path to C-Kermit 8.0.212
- # and must be followed by a plus sign (separated by whitespace).
- #
- # ilodomany: C-Kermit script to invoke ilosetup on a series of HP servers.
- # The names of the servers are on the command line. Prompts once for the
- # created-user password and uses it on all the servers.
- #
- # author: Frank da Cruz, Columbia University, 2009
- #
- .version = 1.04
- # Created:
- # 1.01 20090428
- # Modified:
- # 1.04 20091211: Allow passing of options to ilosetup
- # 1.03 20091104: Fix bugs in ASK/ASKQ prompting;
- # Work around limitation in PUTENV (*)
- # 1.02 20090916: prompt for created user ID as well as password
- #
- # (*) In C-Kermit 8.0.212 only one environment variable could be passed;
- # in C-Kermit 9.0, any number can passed.
- #
- # quitonerror 0 means if an ilosetup invocation fails for any reason,
- # go ahead and do the next one (if any) regardless. Nonzero means
- # stop immediately and not do any more.
-
- .quitonerror = 0 # Set to nonzero if desired
-
- .myname := \fbasename(\v(cmdfile)) # Name of this script without path
- if < \v(version) 800212 {
- exit 1 "\m(myname): C-Kermit 8.0.212 or later required"
- }
- if llt "\v(build)" "20070830" {
- # This is required for PUTENV
- exit 1 "\m(myname): 20070830 or later required"
- }
- if not def \%1 exit 1 "Usage: \m(myname) hostname hostname hostname ..."
-
- undef ilo_options
- for i 1 \v(argc)-1 1 {
- if == 1 \findex(options=,\&_[i]) {
- .ilo_options := \m(ilo_options) \fsubstr(\&_[i],9)
- undef \&_[i]
- }
- }
- .exedir := \fdirname(\v(cmdfile)) # Directory where this script is
- if def \$(DEBUG) { # dev/test
- show mac myname exedir
- show args
- }
- cd \m(exedir) # CD to script's directory
- if fail exit 1 "\m(myname): cd \m(exedir)"
- if not exist ./ilosetup exit 1 "\m(myname): \m(exedir)ilosetup not found"
-
- undef userid # Prompt for created-user ID
- while not def userid {
- ask userid "User ID for created accounts: "
- }
- undef userpass # Prompt for created-user password
- while not def userpass {
- askq /echo:* userpass "Password to set on created accounts: "
- }
- # Note: in C-Kermit 9.0 we can do two putenvs and we don't have to pass
- # the user ID to ilosetup in the open on the command line.
-
- for i 1 \v(argc) 1 {
- if def \%1 {
- if def \$(DEBUG) echo "DOING \%1..."
- putenv ilo_userpass \m(userpass) # Must do this each time
- ! ilo_userid=\m(userid) ./ilosetup \%1 \m(ilo_options)
- if fail if \m(quitonerror) exit 1 "FAILED: ilosetup [\%1]"
- }
- shift # Next host name
- }
- exit 0
-
- ; Local Variables:
- ; comment-column:40
- ; comment-start:"# "
- ; End:
-