]>
git.zerfleddert.de Git - rsbs2/blob - supermicro-kvm.pl
e24cb1926150106eaf07bca70a0118fdc1eea511
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");
51 my $hostalias = $ARGV[0];
53 if (!defined($hostalias) || !defined($Config{$hostalias})) {
54 print STDERR
"Usage: $0 card-alias\n\n";
55 print STDERR
"card-alias\tone of:\n";
56 foreach my $alias (sort keys(%Config)) {
57 print STDERR
"\"${alias}\"\n";
59 print STDERR
"(see ~/.rsbs2rc)\n";
63 my $url = "http://" . ${$Config{$hostalias}}{"host"};
64 login
($url, ${$Config{$hostalias}}{"user"}, ${$Config{$hostalias}}{"pass"});
66 my $response = $ua->get("${url}/cgi/url_redirect.cgi?url_name=ikvm&url_type=jwsk");
67 die $response->status_line if (!($response->is_success));
69 my $jnlp = $response->decoded_content;
71 $jnlp =~ s/(<resources os=\"Linux\" arch=\"amd64\">)/$1<property name=\"jnlp.packEnabled\" value=\"true\"\/><property name
=\"jnlp
.versionEnabled
\" value
=\"true
\"\
/>/;
73 my $fh = File
::Temp
->new(SUFFIX
=> '.jnlp');
74 $fh->unlink_on_destroy(1);
78 $ENV{'AWT_TOOLKIT'} = 'MToolkit';
79 system("javaws", $fh->filename);