summaryrefslogtreecommitdiffstats
path: root/lib/network/nfs.pm
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-03-17 16:49:16 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-03-17 16:49:16 +0000
commitee0aaf75dd71df0113417670d25640d85dc79d86 (patch)
tree74def9fc40e9588ca4291f4b33d679bee7ea2b9c /lib/network/nfs.pm
parent1b68c21e76e919e5e157c3d6250a820793bc1bb3 (diff)
downloaddrakx-net-ee0aaf75dd71df0113417670d25640d85dc79d86.tar
drakx-net-ee0aaf75dd71df0113417670d25640d85dc79d86.tar.gz
drakx-net-ee0aaf75dd71df0113417670d25640d85dc79d86.tar.bz2
drakx-net-ee0aaf75dd71df0113417670d25640d85dc79d86.tar.xz
drakx-net-ee0aaf75dd71df0113417670d25640d85dc79d86.zip
Added network::nfs library.
Diffstat (limited to 'lib/network/nfs.pm')
-rw-r--r--lib/network/nfs.pm37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/network/nfs.pm b/lib/network/nfs.pm
new file mode 100644
index 0000000..e3dca58
--- /dev/null
+++ b/lib/network/nfs.pm
@@ -0,0 +1,37 @@
+package network::nfs;
+
+use strict;
+use common;
+
+sub read_nfs_port_settings {
+ my $statd_port = 4001;
+ my $statd_outgoing_port = 4001;
+ my $lockd_tcp_port = 4002;
+ my $lockd_udp_port = 4002;
+ my $rpc_mountd_port = 4003;
+ my $rpc_rquotad_port = 4004;
+ if (-f "/etc/sysconfig/nfs-common") {
+ foreach (cat_("/etc/sysconfig/nfs-common")) {
+ $_ =~ /^STATD_OPTIONS=.*(--port|-p) (\d+).*$/ and $statd_port = $2;
+ $_ =~ /^STATD_OPTIONS=.*(--outgoing-port|-o) (\d+).*$/ and $statd_outgoing_port = $2;
+ $_ =~ /^LOCKD_TCPPORT=(\d+)/ and $lockd_tcp_port = $1;
+ $_ =~ /^LOCKD_UDPPORT=(\d+)/ and $lockd_udp_port = $1;
+ }
+ }
+ if (-f "/etc/sysconfig/nfs-server") {
+ foreach (cat_("/etc/sysconfig/nfs-server")) {
+ $_ =~ /^RPCMOUNTD_OPTIONS=.*(--port|-p) (\d+).*$/ and $rpc_mountd_port = $2;
+ $_ =~ /^RPCRQUOTAD_OPTIONS=.*(--port|-p) (\d+).*$/ and $rpc_rquotad_port = $2;
+ }
+ }
+
+ { statd_port => $statd_port,
+ statd_outgoing_port => $statd_outgoing_port,
+ lockd_tcp_port => $lockd_tcp_port,
+ lockd_udp_port => $lockd_udp_port,
+ rpc_mountd_port => $rpc_mountd_port,
+ rpc_rquotad_port => $rpc_rquotad_port,
+ }
+}
+
+1;