]>
git.zerfleddert.de Git - rsbs2/blob - supermicro-kvm.pl
afe0523de8bc573c7ed29967178db27a177c9040
9 my $ua = LWP
::UserAgent
->new(cookie_jar
=> {});
10 $ua->default_header('Referer' => 'http://localhost');
17 my $login = { 'name' => $user, 'pwd' => $pass };
18 my $response = $ua->post("${url}/cgi/login.cgi", $login);
19 die $response->status_line if (!($response->is_success));
25 open(INIFILE
,"<${filename}") || die("can't open config: ${filename}: $!");
33 if (m/^\s*\[(.*)\]\s*$/) {
39 if (m/^\s*([^=]+)\s*=\s*(.*)\s*$/) {
40 ${$Ini{$sections[$#sections]}}{$1} = $2;
49 my %Config = read_inifile
("$ENV{HOME}/.rsbs2rc");
53 if (defined($ARGV[0])) {
54 $hostalias = $ARGV[0];
56 print STDERR
"Usage: $0 card-alias\n\n";
57 print STDERR
"card-alias\tone of: ";
58 foreach my $alias (keys(%Config)) {
59 print STDERR
"\"${alias}\" ";
61 print STDERR
"(see ~/.rsbs2rc)\n";
65 my $url = "http://" . ${$Config{$hostalias}}{"host"};
66 login
($url, ${$Config{$hostalias}}{"user"}, ${$Config{$hostalias}}{"pass"});
68 my $response = $ua->get("${url}/cgi/url_redirect.cgi?url_name=ikvm&url_type=jwsk");
69 die $response->status_line if (!($response->is_success));
71 my $jnlp = $response->decoded_content;
73 $jnlp =~ s/(<resources os=\"Linux\" arch=\"amd64\">)/$1<property name=\"jnlp.packEnabled\" value=\"true\"\/><property name
=\"jnlp
.versionEnabled
\" value
=\"true
\"\
/>/;
75 my $fh = File
::Temp
->new(SUFFIX
=> '.jnlp');
76 $fh->unlink_on_destroy(1);
80 system("javaws", $fh->filename);