summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-12 21:06:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-12 21:06:29 +0000
commite5e3c360129d86ba13d7f9eb582de7a8caa914be (patch)
tree8903874b27bfe888620500048db58e308bf0d983
parent57a9679f8c2f8dc39cf6e674075e66e4c4431ac7 (diff)
downloaddrakx-backup-do-not-use-e5e3c360129d86ba13d7f9eb582de7a8caa914be.tar
drakx-backup-do-not-use-e5e3c360129d86ba13d7f9eb582de7a8caa914be.tar.gz
drakx-backup-do-not-use-e5e3c360129d86ba13d7f9eb582de7a8caa914be.tar.bz2
drakx-backup-do-not-use-e5e3c360129d86ba13d7f9eb582de7a8caa914be.tar.xz
drakx-backup-do-not-use-e5e3c360129d86ba13d7f9eb582de7a8caa914be.zip
added wonderful lsnetdrake
-rw-r--r--perl-install/Makefile.config2
-rw-r--r--perl-install/Makefile.drakxtools1
-rwxr-xr-xperl-install/standalone/lsnetdrake36
3 files changed, 38 insertions, 1 deletions
diff --git a/perl-install/Makefile.config b/perl-install/Makefile.config
index 31609029d..7288446c0 100644
--- a/perl-install/Makefile.config
+++ b/perl-install/Makefile.config
@@ -5,7 +5,7 @@ VERSION = 2.2.10-BOOT
SUDO = sudo
SO_FILES = c/blib/arch/auto/c/c.so
PMS = *.pm Newt/*.pm c/stuff.pm resize_fat/*.pm sbus_probing/*.pm network/*.pm commands install2 g_auto_install live_install live_install2
-STANDALONEPMS= diskdrake XFdrake mousedrake printerdrake keyboarddrake draknet localedrake net_monitor drakbug_report tinyfirewall drakxconf drakxservices draksec drakboot adduserdrake drakgw drakautoinst livedrake
+STANDALONEPMS= diskdrake XFdrake mousedrake printerdrake keyboarddrake draknet localedrake net_monitor drakbug_report tinyfirewall drakxconf drakxservices draksec drakboot adduserdrake drakgw drakautoinst livedrake lsnetdrake
PMS += $(STANDALONEPMS:%=standalone/%)
REP4PMS = /usr/bin/perl-install
ROOTDEST = /export
diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools
index 153212f4c..316ff9b37 100644
--- a/perl-install/Makefile.drakxtools
+++ b/perl-install/Makefile.drakxtools
@@ -31,6 +31,7 @@ install:
install $(STANDALONEPMS) $(SBINDEST)
install -s rpcinfo-flushed ddcprobe/ddcxinfos serial_probe/serial_probe $(SBINDEST)
ln -s ../../$(patsubst $(PREFIX)/usr%,%,$(SBINDEST))/XFdrake $(BINX11DEST)/Xdrakres
+ mv -f $(SBINDEST)/lsnetdrake $(BINDEST)/lsnetdrake
install -m 644 *.pm $(LIBDEST)
install -m 644 network/*.pm $(NETLIBDEST)
diff --git a/perl-install/standalone/lsnetdrake b/perl-install/standalone/lsnetdrake
new file mode 100755
index 000000000..548b92657
--- /dev/null
+++ b/perl-install/standalone/lsnetdrake
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+
+use lib qw(.. /usr/lib/libDrakX);
+use network::smb;
+use network::nfs;
+
+"@ARGV" =~ /-h/ and die "usage: lsnetdrake [-h] [--nfs] [--smb]\n";
+
+my $nfs = !@ARGV || "@ARGV" =~ /-(nfs)/;
+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";
+ }
+ }
+}
+
+sub sort_names {
+ sort { $a->{name} cmp $b->{name} } @_;
+}