diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-02-14 20:40:09 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-02-14 20:40:09 +0000 |
commit | 67747f87c523b45fcfd72be841659a71c502bf01 (patch) | |
tree | d7196c4fccebe35f688456fb272ccac69ecfc71b /perl-install/standalone/lsnetdrake | |
parent | 8cb17de0ec7ac28ca28562c5a5475594b5e5ba9b (diff) | |
download | drakx-backup-do-not-use-67747f87c523b45fcfd72be841659a71c502bf01.tar drakx-backup-do-not-use-67747f87c523b45fcfd72be841659a71c502bf01.tar.gz drakx-backup-do-not-use-67747f87c523b45fcfd72be841659a71c502bf01.tar.bz2 drakx-backup-do-not-use-67747f87c523b45fcfd72be841659a71c502bf01.tar.xz drakx-backup-do-not-use-67747f87c523b45fcfd72be841659a71c502bf01.zip |
adapt to the neater network::smb and network::nfs
Diffstat (limited to 'perl-install/standalone/lsnetdrake')
-rwxr-xr-x | perl-install/standalone/lsnetdrake | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/perl-install/standalone/lsnetdrake b/perl-install/standalone/lsnetdrake index 1b2885092..edf3cc54c 100755 --- a/perl-install/standalone/lsnetdrake +++ b/perl-install/standalone/lsnetdrake @@ -1,8 +1,8 @@ #!/usr/bin/perl use lib qw(/usr/lib/libDrakX); -use network::smb; use network::nfs; +use network::smb; "@ARGV" =~ /-h/ and die "usage: lsnetdrake [-h] [--nfs] [--smb]\n"; @@ -12,21 +12,14 @@ my $smb = !@ARGV || "@ARGV" =~ /-(smb)/; $| = 1; $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; -if ($nfs) { - my @servers = network::nfs::find_servers(); - foreach my $server (sort_names(@servers)) { - my $server_name = $server->{name} || $server->{ip}; - foreach (sort_names(network::nfs::find_exports($server))) { - print "$server_name:$_->{name}", $_->{comment} && " ($_->{comment})", "\n"; - } - } -} -if ($smb) { - my @servers = network::smb::find_servers(); - foreach my $server (sort_names(@servers)) { - my $server_name = $server->{name} || $server->{ip}; - foreach (sort_names(network::smb::find_exports($server))) { - print "//$server_name/$_->{name}", $_->{comment} && " ($_->{comment})", "\n"; +my @l; +push @l, network::nfs->new if $nfs; +push @l, network::smb->new if $smb; + +foreach my $class (@l) { + foreach my $server (sort_names($class->find_servers)) { + foreach my $export (sort_names($class->find_exports($server))) { + print $class->to_fullstring($export), "\n"; } } } |