From: Michael Gernoth Date: Sun, 8 Feb 2009 12:03:45 +0000 (+0100) Subject: add options for resetting RSB S2 board an sending raw XML X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/rsbs2/commitdiff_plain/3a88950737f06d296baf044920a263ab10e6fd8a add options for resetting RSB S2 board an sending raw XML --- diff --git a/rsbs2.pl b/rsbs2.pl index 0d2a682..7f5cc0f 100755 --- a/rsbs2.pl +++ b/rsbs2.pl @@ -492,8 +492,10 @@ my $powup = 0; my $powdown = 0; my $powcyc = 0; my $reset = 0; +my $resetrsbs2 = 0; my @sprop = (); my @gprop = (); +my @xmlsend = (); my $show = 0; my $enable_debug = ""; my $save = ""; @@ -538,6 +540,11 @@ while (defined($ARGV[0])) { shift @ARGV; last SWITCH; }; + /^-R$/ && do { + $resetrsbs2 = 1; + shift @ARGV; + last SWITCH; + }; /^-l$/ && do { shift @ARGV; $enable_debug = shift @ARGV; @@ -548,6 +555,11 @@ while (defined($ARGV[0])) { shift @ARGV; last SWITCH; }; + /^-X$/ && do { + shift @ARGV; + push @xmlsend, shift @ARGV; + last SWITCH; + }; /^-b$/ && do { $showstat = 1; shift @ARGV; @@ -587,9 +599,11 @@ if (!$valid_arg) { print STDERR "\t-d\t\tpowerdown\n"; print STDERR "\t-c\t\tpowercycle\n"; print STDERR "\t-r\t\treset\n"; + print STDERR "\t-R\t\treset RSB S2 borad\n"; print STDERR "\t-x\t\tshow all properties, variables and settings\n"; 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-v\t\tverbose\n"; print STDERR "\t-save file\tsave configuration to 'file'\n"; print STDERR "\t-load file\tload configuration from 'file'\n"; @@ -630,6 +644,12 @@ if (@sprop) { } } +if (@xmlsend) { + foreach my $x (@xmlsend) { + print Dumper(_req(''.$x.'')); + } +} + if ($save ne '') { my @dontsave = qw(ENABLE_LAN_AUTONEG ENABLE_LAN_100 ENABLE_LAN_FDUPLEX GATEWAY IP_ADDRESS NETMASK TFTP_FIRMWARE_FILE TFTP_ADDR_FIRMWARE @@ -713,4 +733,10 @@ if ($showstat) { status(); } +if ($resetrsbs2) { + print "Resetting board...\n"; + _cmd("boardreset"); + exit(0); +} + logout();