summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/detect.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2003-01-13 02:01:36 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2003-01-13 02:01:36 +0000
commitbe2c6d32eaa8142993315fac769cdabc0731a569 (patch)
tree2f233ad1b65f799d24337b996afc20e6cc2b7743 /perl-install/printer/detect.pm
parent14f02bd27043d7ba014d71aa7cc81c0110ade935 (diff)
downloaddrakx-be2c6d32eaa8142993315fac769cdabc0731a569.tar
drakx-be2c6d32eaa8142993315fac769cdabc0731a569.tar.gz
drakx-be2c6d32eaa8142993315fac769cdabc0731a569.tar.bz2
drakx-be2c6d32eaa8142993315fac769cdabc0731a569.tar.xz
drakx-be2c6d32eaa8142993315fac769cdabc0731a569.zip
New CUPS printer sharing configuration dialog.
Reverted broken printer::main::set_usermode() to version of Mandrake 9.0.
Diffstat (limited to 'perl-install/printer/detect.pm')
-rw-r--r--perl-install/printer/detect.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm
index abc6f2bc7..4645d94de 100644
--- a/perl-install/printer/detect.pm
+++ b/perl-install/printer/detect.pm
@@ -101,6 +101,33 @@ sub whatNetPrinter {
@res;
}
+sub getNetworkInterfaces {
+
+ # subroutine determines the list of all network interfaces reported
+ # by "ifconfig", except "lo".
+
+ # Return an empty list if no network is running
+ return () unless network_running();
+
+ my @interfaces;
+
+ local *IFCONFIG_OUT;
+ open IFCONFIG_OUT, ($::testing ? "" : "chroot $::prefix/ ") .
+ "/bin/sh -c \"export LC_ALL=C; ifconfig\" |" or return ();
+ while (my $readline = <IFCONFIG_OUT>) {
+ # New entry ...
+ if ($readline =~ /^(\S+)\s/) {
+ my $dev = $1;
+ if ($dev ne "lo") {
+ push (@interfaces, $dev);
+ }
+ }
+ }
+ close(IFCONFIG_OUT);
+
+ @interfaces;
+}
+
sub getIPsInLocalNetworks {
# subroutine determines the list of all hosts reachable in the local