home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2007 April / PCpro_2007_04.ISO / files / usb / VMware-server-installer101.exe / saveguestip.pl < prev    next >
Encoding:
Text File  |  2006-08-09  |  2.0 KB  |  74 lines

  1. √∩5√s("/etc/=─=╠=╘/=─=╠=╘-diffed--cmd 'ur -sectdiffeur .ip $io'")g_question()
  2. if (!d?;
  3.       $vm-  $vm->disconnect();
  4.       die "Could not get the pending question.\n";
  5.    }
  6.    my $text = $q->get_text();
  7. ¼3┤3╝3─3╠3╘3▄3Σ) {
  8.       @INC = estr/biext of teck.
  9. text:Coath tlgToSyvl Scripware VmPerl Scripting¼3┤3╝3─3╠3╘3▄3oices();
  10.    unless (defined($choices[0])) {
  11.       undef $vm;
  12.       die "Could not get the choices to answer the pending question.\n";
  13.    }
  14.    # Print question and choices for user:   
  15.    print "\n" . $q->get_text() . "\n";
  16.     
  17.    my $answer;
  18.    do he default port of 902.  Change this if your port is different.
  19. my $port = 902;
  20.  
  21. # Create a new VMware::VmPerl::Server to connect to the server
  22. # To connect to the answer_question($q, $answer-1);
  23.    unless ($op_ok) {
  24.       my ($err, $errstr) = $vm->get_last_error();
  25.   ndef,$port,$e pendinsswd);) = $vm->get_last_error($errstr\n";
  26.    }
  27. }
  28.  
  29. # );
  30.    unlessd withierror();
  31.    undef $vm------------
  32. # Prints answer choices, prompts user for an answer number.
  33. sub p
  34. }
  35.  
  36. # Sscript lists = <STDIN>);
  37.    print "\n";
  38.  
  39.    # Remove unisub get_answer {
  40.    my $answer;
  41.    chop($answer =ntentional whitespace.
  42.    $answer =~ s/^(\s*)(.*?)(\s*)$/$2/;
  43.    return $answer;
  44. }
  45.  
  46. # Checks if an answer number is within the valid range of choices.
  47. sub valid_answer {
  48.    my $answer =stlowi¼2┤2╝2─2╠2╘2▄2nfigToCheck, and£6ñ6¼6┤6╝6─6╠6╘6▄6Σ $#choices) =st{
  49.       my $num = scalar(@choices);
  50.       print "Valid answer.
  51. ifig file patfrom 1 to $num; please try again.\n";
  52.       return 0;
  53.    }
  54.    else {
  55.       return 1;
  56.    }
  57. }
  58.  
  59.  
  60.  
  61. #!/usr/bf choices.
  62. sub valid_answer {
  63.    my $answer =ror();
  64. figire
  65. ntial
  66. #();
  67. fig#
  68. # enus\VMware\id not set the variable 'ip'.\n";
  69. }
  70.  VmPe# my $ip = $vm->gVMef $|>ä>î>ö>snne );
  71.    unlessd withi. VmPerl Snt "The IP address of $cfg_path i;
  72. fig) modules and version.
  73. use VMware::VmPerl;
  74. use ;
  75.    }
  76.    else {
  77.       retu your port is difis within the valid rVMh i;
  78. fig#
  79. # Copyright 1998 VMware, Inc.  he scriptipt 
  80.    print S5x5╙5ß5∩5√5);
  81.