From e50748d5af082b1fb20e868b5ac1c63eadd14c5a Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Mon, 9 Feb 2009 00:31:36 +0100 Subject: [PATCH] add parameter to perl CLI to start GUI in appletviewer --- rsbs2.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rsbs2.pl b/rsbs2.pl index 601e332..ee2fa24 100755 --- a/rsbs2.pl +++ b/rsbs2.pl @@ -552,6 +552,7 @@ my $enable_debug = ""; my $save = ""; my $load = ""; my $showstat = 0; +my $gui = 0; my $hostalias; while (defined($ARGV[0])) { @@ -616,6 +617,11 @@ while (defined($ARGV[0])) { shift @ARGV; last SWITCH; }; + /^-G$/ && do { + $gui = 1; + shift @ARGV; + last SWITCH; + }; /^-save$/ && do { shift @ARGV; $save = shift @ARGV; @@ -655,6 +661,7 @@ if (!$valid_arg) { print STDERR "\t-l IP\t\tsend SYSLOG debug messages to IP\n"; print STDERR "\t-b\t\tshow board/server status\n"; print STDERR "\t-X\t\tsend raw XML string (start with REQ tag)\n"; + print STDERR "\t-G\t\tstart GUI in appletviewer\n"; print STDERR "\t-v\t\tverbose\n"; print STDERR "\t-save file\tsave configuration to 'file'\n"; print STDERR "\t-load file\tload configuration from 'file'\n"; @@ -671,6 +678,19 @@ $host = ${$Config{$hostalias}}{"host"}; $poweronms = ${$Config{$hostalias}}{"poweronms"} if (defined(${$Config{$hostalias}}{"poweronms"})); $poweroffms = ${$Config{$hostalias}}{"poweroffms"} if (defined(${$Config{$hostalias}}{"poweroffms"})); +if ($gui) { + open(APPLET,"|appletviewer /dev/stdin"); + print APPLET 'RSB S2 User Interface'; + print APPLET ''; + print APPLET ''; + print APPLET ''; + print APPLET ''; + print APPLET ''; + print APPLET ''; + print APPLET ''; + close(APPLET); +} + $sid = login(${$Config{$hostalias}}{"user"}, ${$Config{$hostalias}}{"pass"}); if ($show) { -- 2.39.2