From d5e3ce21367fc09cdcff59993d66ea9607e2d333 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Thu, 5 Feb 2009 08:18:24 +0100 Subject: [PATCH] retrieve userlist, so user properties can bes saved and restored, too --- rsbs2.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/rsbs2.pl b/rsbs2.pl index a481f45..3b752c2 100755 --- a/rsbs2.pl +++ b/rsbs2.pl @@ -279,6 +279,22 @@ sub show_all_vars { } } +sub usrlist { + my $reqstr = ''; + my $res = _req($reqstr); + my @users = (); + + if ($res->{RESP}->{RC} ne '0x0') { + print "FAILED:".$res->{RESP}->{RC}."\n"; + (); + } else { + foreach my $usr (@{$res->{RESP}->{USRLIST}->{USER}}) { + push @users, $usr->{NAME}; + } + } + @users; +} + sub syslog_debug { my $destination_ip = shift; my $bcast = shift; @@ -506,6 +522,9 @@ if ($save ne '') { print SAVEFILE "${ts}=".$phash->{VAL}."\n"; print STDERR "." if (!$verbose); } + foreach my $usr (usrlist()) { + print STDERR "TODO: save user ${usr}\n"; + } close(SAVEFILE); print STDERR "done\n" if (!$verbose); } -- 2.39.5