my $sid;
my $host;
my $poweronms=200;
-my $poweroffms=4500;
+my $poweroffms=5000;
my $verbose = 0;
my @fw_vars = qw(ENABLE_LAN_AUTONEG ENABLE_LAN_100 ENABLE_LAN_FDUPLEX GATEWAY
IP_ADDRESS NETMASK TFTP_FIRMWARE_FILE TFTP_ADDR_FIRMWARE ENABLE_DHCP
- ENABLE_DNS DNS_SERVER DNS_DOMAIN_NAME DHCP_CONFIGURE_DNS
+ ENABLE_DNS DNS_SERVER DNS_DOMAIN_NAME
ACCESS_CONTROL_SERVER_1 ACCESS_CONTROL_SERVER_2 ACCESS_CONTROL_SERVERS
ACPI_DISABLE_BIOS_SCAN ACPI_FORCE_RSDP_ADDRESS ACPI_FORCE_RSDT_ADDRESS
ACPI_RSDP_BIOS_ROM_ADDRESS ACPI_SCAN_DELAY_SECONDS AMR_AUTH_METHOD
CONSOLE_VIDEO_PARAM_MODE CONTACT CONTACT_PHONE CRIT_TEMP_SHUTDOWN
CRIT_VOLT_SHUTDOWN DHCP_ADD_EXTENSION DHCP_ADD_SERIAL
DHCP_CONFIGURE_DNS DHCP_HOSTNAME_EXT DHCP_SERVER DHCP_USE_CARDNAME
- DIAG_URL DNS_DOMAIN_NAME DNS_SERVER ENABLE_ANON_IPMI ENABLE_ANON_PCI
+ DIAG_URL ENABLE_ANON_IPMI ENABLE_ANON_PCI
ENABLE_ANON_WEB ENABLE_AVR_CHIP_DETECT ENABLE_BMC_AUTODETECT
ENABLE_BMC_TIMESYNC ENABLE_CRTC_FETCH ENABLE_DHCP ENABLE_DHCP_HOSTNAME
- ENABLE_DNS ENABLE_DS_CONNECTIVITY ENABLE_IO_UART_DECODER ENABLE_LAN_100
+ ENABLE_DS_CONNECTIVITY ENABLE_IO_UART_DECODER ENABLE_LAN_100
ENABLE_LAN_AUTONEG ENABLE_LAN_FDUPLEX ENABLE_MEM_UART_DECODER
ENABLE_PPP ENABLE_REMOTE_FLOPPY_BOOT ENABLE_SELF_DELETE
ENABLE_SERIAL_DBG ETHDRIVER_SID EXPROM_BANNER EXPROM_EBDA_COMPATIBILITY
my $reqstr='<?xml version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="propget"><PROPLIST><PROP NAME="'.$property.'"/></PROPLIST></REQ></RMCSEQ>';
my $resp = _req($reqstr);
+
+ print "get: ${property}\n" if ($verbose);
if ($resp->{RESP}->{RC} ne '0x0') {
$resp->{RESP}->{RC};
if ($res->{RESP}->{RC} ne '0x0') {
print "Error setting ${property} to ${value}: ".$res->{RESP}->{RC}."\n";
} else {
- print "${property}: ${oldval} -> ${value}\n" if ($verbose);
+ print "${property}: ${oldval} -> ${value}\n";
}
}
}
}
-if (!defined(${$Config{$hostalias}}{'host'})) {
+if ($valid_arg && (!defined(${$Config{$hostalias}}{'host'}))) {
$valid_arg = 0;
}
}
if ($save ne '') {
- print "save: implement me!\n";
+ my @dontsave = qw(ENABLE_LAN_AUTONEG ENABLE_LAN_100 ENABLE_LAN_FDUPLEX
+ GATEWAY IP_ADDRESS NETMASK TFTP_FIRMWARE_FILE TFTP_ADDR_FIRMWARE
+ ENABLE_DHCP HELP_LOCATION HELP_LOCATION PPP_PORT PPP2_INIT PPP2_PORT
+ SERVER_ID SNMP_SERVER_1 SNMP_SERVER_2 SNMP_SERVER_3 SNMP_SERVER_4
+ SNMP_SERVER_5 SNMP_SERVER_6 SNMP_SERVER_7 SERVER_AD_NAME
+ SERVER_AD_NAME2 SERVER_AD_NAME3 SERVER_AD_NAME4 SERVER_MAC_ADDRESS
+ SERVER_MAC_ADDRESS2 SERVER_MAC_ADDRESS3 SERVER_MAC_ADDRESS4
+ MAC_ADDRESS LAST_CARD_NAME LAST_ENABLE_DHCP LAST_GATEWAY
+ LAST_IP_ADDRESS LAST_NETMASK);
+
+ open (SAVEFILE, ">${save}") || die "Error opening save-file: $!\n";
+ foreach my $ts (@fw_vars) {
+ next if (grep(/^${ts}$/, @dontsave));
+
+ my $phash = _getprop($ts)->{RESP}->{PROPLIST}->{PROP};
+ next if ($phash->{PERMS} ne 'RW');
+
+ print SAVEFILE "${ts}=".$phash->{VAL}."\n";
+ }
+ close(SAVEFILE);
}
if ($load ne '') {
- print "load: implement me!\n";
+ open (LOADFILE, "<${load}") || die "Error opening load-file: $!\n";
+ while(<LOADFILE>) {
+ chomp;
+ (my $p, my $v) = split(/=/, $_);
+ setprop($p, $v);
+ }
+ close(LOADFILE);
+ print "Settings loaded, resetting board...\n";
+ my $reqstr='<?XML version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="boardreset"></REQ></RMCSEQ>';
+ _req($reqstr);
+ exit(0);
}
if ($enable_debug ne '') {