+if (@gprop) {
+ foreach my $p (@gprop) {
+ showprop($p);
+ }
+}
+
+if (@sprop) {
+ foreach my $p (@sprop) {
+ (my $pr, $v) = split(/=/,$p,2);
+ setprop($pr, $v);
+ }
+}
+
+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
+ 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 '') {
+ 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 '') {
+ syslog_debug($enable_debug, "TRUE");
+}